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: 2018-08-06 08:43:11 +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 2018-08-06 08:43:11 +0545 | Revision a7e2d08195603b74afe135061b6d943418020382 -->

Happy Jekyll’ing!