You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-10Lines changed: 18 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -32,14 +32,17 @@ plugins:
32
32
33
33
> If you have no `plugins` entry in your config file yet, you'll likely also want to add the `search` plugin. MkDocs enables it by default if there is no `plugins` entry set.
34
34
35
-
### Note when using on CI runners
35
+
### Note when using build environments
36
36
37
-
The plugin needs access to the last commit that touched a file to be able to retrieve the date. If you build your docs using CI then you might need to change your settings:
37
+
This plugin needs access to the last commit that touched a specific file to be able to retrieve the date. By default many build environments only retrieve the last commit, which means you might need to:
38
+
<details>
39
+
<summary>Change your CI settings</summary>
40
+
41
+
- github actions: set `fetch_depth` to `0` ([docs](https://github.com/actions/checkout))
42
+
- gitlab runners: set `GIT_DEPTH` to `1000` ([docs](https://docs.gitlab.com/ee/user/project/pipelines/settings.html#git-shallow-clone))
43
+
- bitbucket pipelines: set `clone: depth: full` ([docs](https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/))
44
+
</details>
38
45
39
-
- github actions: set `fetch_depth` to `0` ([docs](https://github.com/actions/checkout))
40
-
- gitlab runners: set `GIT_DEPTH` to `1000` ([docs](https://docs.gitlab.com/ee/user/project/pipelines/settings.html#git-shallow-clone))
41
-
42
-
----
43
46
44
47
## Usage
45
48
@@ -72,9 +75,10 @@ You can customize the plugin by setting options in `mkdocs.yml`. For example:
72
75
```yml
73
76
plugins:
74
77
- git-revision-date-localized:
75
-
type: timeago
76
-
locale: en
77
-
fallback_to_build_date: false
78
+
type: timeago
79
+
time_zone: Europe/Amsterdam
80
+
locale: en
81
+
fallback_to_build_date: false
78
82
```
79
83
80
84
### `type`
@@ -89,6 +93,10 @@ Default is `date`. To change the date format, set the `type` parameter to one of
89
93
20 hours ago # type: timeago
90
94
```
91
95
96
+
### `time_zone`
97
+
98
+
Default is `UTC`. Specify a time zone database name ([reference](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)). This option is especially relevant when using `type: datetime` and `type: iso_datetime`. Note that when using [timeago](http://timeago.yarp.com/) (with `type: timeago`) any difference in time zones between server and client will be handled automatically.
99
+
92
100
### `locale`
93
101
94
102
Default is `None`. Specify a two letter [ISO639](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) language code to display dates in your preferred language.
@@ -99,7 +107,7 @@ Default is `None`. Specify a two letter [ISO639](https://en.wikipedia.org/wiki/L
99
107
100
108
### `fallback_to_build_date`
101
109
102
-
Default is `false`. If set to `true` the plugin will use the time when running `mkdocs build` instead of the git revision date. This means the revision date will be inaccurate, but this can be useful if your build environment has no access to GIT and you want to ignore the Git exceptions during `git log`.
110
+
Default is `false`. If set to `true` the plugin will use the time at `mkdocs build` instead of the file's last git revision date. This means the revision date is incorrect, but this can be acceptable if you want your project to also successfully build in environments with no access to GIT.
0 commit comments