1 min read

Jekyll site last modified time

If you are using Jekyll to generate your site or blog, you might want to know the last exact site modified/generated time as the Jekyll generate and keep the files in _site folder.

I found the following liquid tag to do it:

{{ site.time }}

To know modified time according to your locale timezone you have to add your tz database time zone in your _config.yml:

timezone: Asia/Kathmandu # add your own locale timezone

And you can add this in the end of your website source code:

<!-- Last modified at: {{ site.time }} -->

Which output as:

<!-- Last modified at: 2017-02-04 08:11:29 +0545 -->

If you are hosting your site on GitHub Pages and using Jekyll:

<!-- Proudly Hosted on GitHub | Generated {{ site.time }} | Revision {{ site.github.build_revision }} -->

Which output in following format:

<!-- Proudly Hosted on GitHub | Generated 2017-02-04 08:11:29 +0545 | Revision 3b01d1a3926af331c910da11cd15231ede342594 -->

Happy Jekyll’ing!