2019-12-11 19:47:48 +03:00
|
|
|
# Revision date
|
|
|
|
|
2020-03-10 16:07:03 +03:00
|
|
|
The [mkdocs-git-revision-date-localized-plugin][1] will add the date on which a
|
2020-03-20 18:47:47 +03:00
|
|
|
Markdown file was last updated at the bottom of each page.
|
2020-03-10 01:12:10 +03:00
|
|
|
|
|
|
|
!!! success "Bundled with the official Docker image"
|
|
|
|
|
|
|
|
This plugin is already installed for your convenience when you use the
|
|
|
|
official [Docker image][2], so the installation step can be skipped. Read
|
|
|
|
the [getting started guide][3] to get up and running with Docker.
|
2019-12-11 19:47:48 +03:00
|
|
|
|
|
|
|
[1]: https://github.com/timvink/mkdocs-git-revision-date-localized-plugin
|
2020-03-10 01:12:10 +03:00
|
|
|
[2]: https://hub.docker.com/r/squidfunk/mkdocs-material/
|
|
|
|
[3]: ../getting-started.md#with-docker-recommended
|
2019-12-11 19:47:48 +03:00
|
|
|
|
2020-03-20 18:47:47 +03:00
|
|
|
!!! warning "Requirements"
|
|
|
|
|
|
|
|
The date is extracted at the time of the build, so `mkdocs build` must be
|
|
|
|
triggered from within a git repository.
|
|
|
|
|
2019-12-11 19:47:48 +03:00
|
|
|
## Installation
|
|
|
|
|
2020-03-10 01:12:10 +03:00
|
|
|
Install the plugin using `pip`:
|
2019-12-11 19:51:26 +03:00
|
|
|
|
|
|
|
``` sh
|
|
|
|
pip install mkdocs-git-revision-date-localized-plugin
|
|
|
|
```
|
|
|
|
|
2020-03-10 01:12:10 +03:00
|
|
|
## Configuration
|
|
|
|
|
|
|
|
Add the following lines to `mkdocs.yml`:
|
2019-12-11 19:47:48 +03:00
|
|
|
|
|
|
|
``` yaml
|
|
|
|
plugins:
|
2020-03-10 01:12:10 +03:00
|
|
|
- search # necessary for search to work
|
2019-12-11 19:47:48 +03:00
|
|
|
- git-revision-date-localized
|
|
|
|
```
|
|
|
|
|
2020-03-10 01:12:10 +03:00
|
|
|
Note that the date is printed according to the locale which is determined
|
|
|
|
through the [theme language][2] that was set in `mkdocs.yml`.
|
2019-12-18 19:13:17 +03:00
|
|
|
|
2020-03-10 01:12:10 +03:00
|
|
|
[2]: ../getting-started.md/#language
|
2019-12-11 19:47:48 +03:00
|
|
|
|
2020-03-10 01:12:10 +03:00
|
|
|
### Language
|
2019-12-11 19:47:48 +03:00
|
|
|
|
2020-03-10 01:12:10 +03:00
|
|
|
The language (i.e. locale) is deduced from the `theme.language` option.
|
2019-12-11 19:47:48 +03:00
|
|
|
|
2020-03-10 01:12:10 +03:00
|
|
|
### Format
|
2019-12-11 19:47:48 +03:00
|
|
|
|
2020-03-10 01:12:10 +03:00
|
|
|
> Default: `date`
|
2019-12-11 19:47:48 +03:00
|
|
|
|
|
|
|
To change the date format, set the `type` parameter to one of `date`,
|
2020-03-10 01:12:10 +03:00
|
|
|
`datetime`, `iso_date`, `iso_datetime` or `timeago`, e.g.:
|
2019-12-11 19:47:48 +03:00
|
|
|
|
|
|
|
``` yaml
|
|
|
|
plugins:
|
2020-03-10 01:12:10 +03:00
|
|
|
- search # necessary for search to work
|
2019-12-11 19:47:48 +03:00
|
|
|
- git-revision-date-localized:
|
2020-03-10 01:12:10 +03:00
|
|
|
type: date
|
2019-12-11 19:47:48 +03:00
|
|
|
```
|
|
|
|
|
2020-03-10 01:12:10 +03:00
|
|
|
The following formats are supported:
|
2019-12-11 19:47:48 +03:00
|
|
|
|
2020-03-10 01:12:10 +03:00
|
|
|
``` gnuplot
|
|
|
|
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
|
2019-12-11 19:47:48 +03:00
|
|
|
```
|
2020-03-10 01:12:10 +03:00
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
|
|
|
When enabled, the respective date is automatically added at the bottom of each
|
|
|
|
page, e.g.:
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
<small>
|
2020-03-10 16:07:03 +03:00
|
|
|
Last updated: 28 November, 2019
|
2020-03-10 01:12:10 +03:00
|
|
|
</small>
|