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: 2019-04-04 00:03:07 +0300 -->

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 2019-04-04 00:03:07 +0300 | Revision 695b2655ce454cc4a5b305a39859be031e96b46e -->

Happy Jekyll’ing!