The mkdocs-git-revision-date-localized-plugin will add the date on which a Markdown file was last updated at the bottom of each page.
Bundled with the official Docker image
This plugin is already installed for your convenience when you use the official Docker image, so the installation step can be skipped. Read the getting started guide to get up and running with Docker.
The date is extracted at the time of the build, so
mkdocs build must be triggered from within a git repository.
Install the plugin using
pip install mkdocs-git-revision-date-localized-plugin
Add the following lines to
plugins: - search # necessary for search to work - git-revision-date-localized
Note that the date is printed according to the locale which is determined through the theme language that was set in
The language (i.e. locale) is deduced from the
To change the date format, set the
type parameter to one of
plugins: - search # necessary for search to work - git-revision-date-localized: type: date
The following formats are supported:
28 November, 2019 # type: date 28 November, 2019 13:57:28 # type: datetime 2019-11-28 # type: iso_date 2019-11-28 13:57:26 # type: iso_datetime 20 hours ago # type: timeago
When enabled, the respective date is automatically added at the bottom of each page, e.g.:
Last updated: 28 November, 2019