First post - so please be gentle! and apologies if I’m asking in the wrong place…
I’m playing with a gh pages site using Jekyll and the Leap Day theme, and I’m trying to figure out how i can include “Page Last Updated: date…” in the footer.
I’ve sort of worked out that I need to include some liquid in the footer of the default.html template (been messing about with other stuff). Problem is I can’t figure out or find any information about what liquid to include.
site.time isn’t the same as last modified, it’s just the current time when Jekyll builds your site.
You’ll likely want to set the DateTime of your post/page with something like last_modified_at: in its YAML front matter. If you can install Jekyll plugins you can use this one and it’ll set the last modified datetimes for you.Then you can access it via your layouts or includes with {{ page.last_modified_at }}.
I suggest calling it the variable last_modified_at because many of Jekyll’s official plugins like jekyll-feed and jekyll-sitemap support it.
3rd party plugins don’t work with GitHub Pages so that’s likely the issue. They only allow a select few due to security reasons.
You can use the plugin but it’ll have to be if you self host elsewhere or use something like Travis CI to build your Jekyll site and push the contents of _site back to GitHub to host.
You can still use last_modified_at, you’ll just need to manually update that timestamp in your post/page’s YAML Front Matter. Depending on the text editor you use there might be options. For example I use Sublime Text and Visual Studio Code, and both have extensions/macros for quickly updating a timestamp.