|
1 | 1 | # mkdocs-git-revision-date-localized-plugin
|
2 | 2 |
|
3 |
| -[MkDocs](https://www.mkdocs.org/) plugin that enables displaying the localized date of the last git modification of a markdown file. Forked from [mkdocs-git-revision-date-plugin](https://github.com/zhaoterryy/mkdocs-git-revision-date-plugin). |
| 3 | +[MkDocs](https://www.mkdocs.org/) plugin that enables displaying the localized date of the last git modification of a markdown file. Forked from [mkdocs-git-revision-date-plugin](https://github.com/zhaoterryy/mkdocs-git-revision-date-plugin). The plugin uses [babel](https://github.com/python-babel/babel/tree/master/babel) and [timeago](https://github.com/hustcc/timeago) to provide different localized date formats. |
4 | 4 |
|
5 |
| - |
| 5 | + |
6 | 6 |
|
7 | 7 | (*Example when used together with [mkdocs-material](https://github.com/squidfunk/mkdocs-material) theme*)
|
8 | 8 |
|
@@ -41,30 +41,33 @@ In your markdown files you can use `{{ git_revision_date_localized }}`:
|
41 | 41 | Last update: {{ git_revision_date_localized }}
|
42 | 42 | ```
|
43 | 43 |
|
44 |
| -## Localizated variants |
45 | 44 |
|
46 |
| -The plugin uses [babel](https://github.com/python-babel/babel/tree/master/babel) and [timeago](https://github.com/hustcc/timeago) to provide different date formats: |
| 45 | +## Options |
47 | 46 |
|
48 |
| -```django hljs |
49 |
| -{{ git_revision_date_localized }} |
50 |
| -{{ git_revision_date_localized_time }} |
51 |
| -{{ git_revision_date_localized_iso }} |
52 |
| -{{ git_revision_date_localized_iso_time }} |
53 |
| -{{ git_revision_date_localized_timeago }} |
54 |
| -``` |
| 47 | +### `type` |
55 | 48 |
|
56 |
| -Output: |
| 49 | +Set this option to one of `date`, `datetime`, `iso_date`, `iso_datetime` or `timeago`. Default is `date`. Example outputs: |
57 | 50 |
|
| 51 | +```bash |
| 52 | +28 November, 2019 # type: date |
| 53 | +28 November, 2019 13:57:28 # type: datetime |
| 54 | +2019-11-28 # type: iso_date |
| 55 | +2019-11-28 13:57:26 # type: iso_datetime |
| 56 | +20 hours ago # type: timeago |
58 | 57 | ```
|
59 |
| -28 November, 2019 |
60 |
| -28 November, 2019 13:57:28 |
61 |
| -2019-11-28 |
62 |
| -2019-11-28 13:57:26 |
63 |
| -20 hours ago |
64 |
| -``` |
65 |
| - |
66 |
| -## Options |
67 | 58 |
|
68 | 59 | ### `locale`
|
69 | 60 |
|
70 | 61 | Set this option to a two letter [ISO639](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code to use a another language. This will overwrite any locale setting in `mkdocs` or your theme. If no locale is set fallback is English (`en`).
|
| 62 | + |
| 63 | +### Example |
| 64 | + |
| 65 | +Setting a different configuration: |
| 66 | + |
| 67 | +```yaml |
| 68 | +# mkdocs.yml |
| 69 | +plugins: |
| 70 | + - git-revision-date-localized: |
| 71 | + type: timeago |
| 72 | + locale: nl |
| 73 | +``` |
0 commit comments