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-10-21 07:28:52 +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-10-21 07:28:52 +0545 | Revision acef51bcf1dcacaf7f93e3eb72d0db9143084d78 -->

Happy Jekyll’ing!