Skip to content

Commit 9e7a9f5

Browse files
committed
Update partial example for source-file.html of mkdocs-material theme
1 parent 0dced04 commit 9e7a9f5

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

docs/howto/override-a-theme.md

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,27 @@ If you want, you can customize further by [extending the mkdocs-material theme](
5959
```html
6060
{% import "partials/language.html" as lang with context %}
6161

62-
<!-- Last updated date -->
63-
{% set label = lang.t("source.file.date.updated") %}
62+
<!-- taken from
63+
https://github.com/squidfunk/mkdocs-material/blob/master/src/partials/source-file.html -->
64+
6465
<hr />
65-
<div class="md-source-date">
66+
<div class="md-source-file">
6667
<small>
6768

6869
<!-- mkdocs-git-revision-date-localized-plugin -->
6970
{% if page.meta.git_revision_date_localized %}
70-
{{ label }}: {{ page.meta.git_revision_date_localized }}
71-
71+
{{ lang.t("source.file.date.updated") }}:
72+
{{ page.meta.git_revision_date_localized }}
7273
{% if page.meta.git_creation_date_localized %}
73-
<br />{{ lang.t("source.file.date.created") }}: {{ page.meta.git_creation_date_localized }}
74+
<br />
75+
{{ lang.t("source.file.date.created") }}:
76+
{{ page.meta.git_creation_date_localized }}
77+
{% endif %}
78+
79+
<!-- mkdocs-git-revision-date-plugin -->
80+
{% elif page.meta.revision_date %}
81+
{{ lang.t("source.file.date.updated") }}:
82+
{{ page.meta.revision_date }}
7483
{% endif %}
7584
</small>
7685
</div>

0 commit comments

Comments
 (0)