A Jekyll plugin that sets the page variable page.mtime
to the time of the last commit or change.
The git executable must be found within PATH.
Display the time of the last change in the page footer. Usually the time of last change shall refer to the current page, only. Regarding special pages like index or sitemap, the time of last change regarding any page shall be used instead.
Per default page.mtime
is set to the time of the last commit related to the current page or to the page's file mtime if there are uncommited changes regarding the page.
Within any page:
{{ page.mtime }}
The liquid filter date maybe used for formatting:
{{ page.mtime | date: '%Y-%m-%d' }}
By specifying mtime: site
or mtime: branch
the plugin is configured to update the mtime
-value based on the history of the whole site. This means that page.mtime
is set to the time of the last commit (regarding the current branch & the whole site) or to the instant of the current build (site.time) if there are uncommited changes.
---
mtime: site
---
{{ page.mtime }}
page.mtime
can be set to the the instant of the current build (site.time) by specifying mtime: build
or mtime: site.time
in the yaml frontmatter.
---
mtime: build
---
{{ page.mtime | date: '%Y-%m-%d' }}=={{ site.time | date: '%Y-%m-%d' }}
Any other value assigned to page.mtime
other than the keywords explained above is retained:
---
mtime: something
---
{{ page.mtime }}{% comment %} prints 'something' {% endcomment %}