Jiang Wu Data Engineer @ Adyen (NL)

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: 2020-12-29 20:29:37 +0000 -->

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 2020-12-29 20:29:37 +0000 | Revision 2ce6ab0d65e04dab56df8247e411e2b553c2c893 -->

Happy Jekyll’ing!