zero's a life

An extra chance.

New Year, New Footer

| Comments

It’s 2015. Time to update my footer. I came across a link to a website called, updateyourfooter.com. It describes ways to dynamically update footer info in a variety of languages.

I set out to intrepidly implement one of the JavaScript snippets from the website in the source/_includes/custom/footer.html file in my Octopress install. But, to my surprise, there was a bit of code in the footer that already dynamically generated the date timestamp for the footer.

The code looks like this:

{{ site.time | date: "%Y" }}

Ready for this? Octopress is a framework built on top of Jekyll. Jekyll uses Shopify’s Liquid Template Engine. All of that is a fancy way of saying that this code is compiled into useful stuff for my site.

All I had to do was preface that with the year my blog was established, and badabing, no-mess dynamic footer. Now the relevant section of the footer looks like this:

Copyright © 2014 – {{ site.time | date: "%Y" }}

You can see the results at the bottom of this page.

Comments