1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2024-11-28 01:10:58 +01:00

Updated built files and fixed revision date integration

This commit is contained in:
squidfunk 2019-12-11 17:47:48 +01:00
parent f08f2fbf65
commit afe1d65b15
42 changed files with 166 additions and 134 deletions

View File

@ -0,0 +1,59 @@
# Revision date
[mkdocs-git-revision-date-localized-plugin][1] is an extension that shows the
date on which a Markdown file was last updated in _Git_ at the bottom of each
page. The date is extracted at the time of the build, so `mkdocs build` must
be triggered from within a Git repository.
[1]: https://github.com/timvink/mkdocs-git-revision-date-localized-plugin
## Installation
Add the following lines to your `mkdocs.yml`:
``` yaml
plugins:
- git-revision-date-localized
```
## Usage
The date is automatiaclly added at the bottom of each page, e.g.:
```
Last updated: 9 December, 2019
```
### Changing the language
The date is printed according to the locale which is determined through the
[theme language][1] that was set in `mkdocs.yml`.
[1]: https://squidfunk.github.io/mkdocs-material/getting-started/#language
### Changing the format
To change the date format, set the `type` parameter to one of `date`,
`datetime`, `iso_date`, `iso_datetime` or `timeago`, i.e.:
``` 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
```
Example:
``` yaml
plugins:
- git-revision-date-localized:
type: timeago
```
Result:
```
20 hours ago
```

View File

@ -1,45 +0,0 @@
# Revision date
[mkdocs-git-revision-date-localized-plugin](https://github.com/timvink/mkdocs-git-revision-date-localized-plugin) is an extension that enables adding a revision date to a markdown file.
As the name says, it takes this revision date from GIT.
## Installation
Add the following lines to your `mkdocs.yml`:
``` yaml
plugins:
- git-revision-date-localized
```
## Usage
Material for MkDocs will add the revision date to the bottom of every markdown page, for example:
```
Last updated: 9 December 2019
```
To change the language, set the theme language, see [Getting started - Language][1].
[1]: https://squidfunk.github.io/mkdocs-material/getting-started/#language
To change the date format, set the `type` parameter to one of `date`, `datetime`, `iso_date`, `iso_datetime` or `timeago`. Default is `date`. Example outputs:
```bash
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
```
Example setting:
```yaml
# mkdocs.yml
plugins:
- git-revision-date-localized:
type: timeago
```

View File

@ -180,14 +180,21 @@
</a>
{% endif %}
{% endblock %}
{% if page and page.meta and (
page.meta.git_revision_date_localized or
page.meta.revision_date
) %}
{% set label = lang.t("source.revision.date") %}
<hr>
<div class="md-source-date">
<small>
{% if page.meta.git_revision_date_localized %}
<small>
{{ lang.t('last.update') }}: {{ page.meta.git_revision_date_localized }}
</small>
{{ label }}: {{ page.meta.git_revision_date_localized }}
{% elif page.meta.revision_date %}
<small>
{{ lang.t('last.update') }}: {{ page.meta.revision_date }}
{{ label }}: {{ page.meta.revision_date }}
{% endif %}
</small>
</div>
{% endif %}
{% endblock %}
{% block disqus %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# ooreenstemmende dokumente",
"skip.link.title": "Slaan oor na inhoud",
"source.link.title": "Slaan oor na inhoud",
"toc.title": "Inhoudsopgawe",
"last.update": "Laaste opdatering"
"source.revision.date": "Laaste opdatering",
"toc.title": "Inhoudsopgawe"
}[key] }}{% endmacro %}

View File

@ -21,6 +21,6 @@
"search.result.other": "نتائج البحث # مستندات",
"skip.link.title": "انتقل إلى المحتوى",
"source.link.title": "اذهب إلى المصدر",
"toc.title": "جدول المحتويات",
"last.update": "اخر تحديث"
"source.revision.date": "اخر تحديث",
"toc.title": "جدول المحتويات"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# documents coincidents",
"skip.link.title": "Salta el contingut",
"source.link.title": "Ves al repositori",
"toc.title": "Taula de continguts",
"last.update": "Darrera actualització"
"source.revision.date": "Darrera actualització",
"toc.title": "Taula de continguts"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "Nalezené dokumenty: #",
"skip.link.title": "Přeskočit obsah",
"source.link.title": "Přejít do repozitáře",
"toc.title": "Obsah",
"last.update": "Poslední aktualizace"
"source.revision.date": "Poslední aktualizace",
"toc.title": "Obsah"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# resultater",
"skip.link.title": "Gå til indholdet",
"source.link.title": "Åbn arkiv",
"toc.title": "Indholdsfortegnelse",
"last.update": "Sidste ændring"
"source.revision.date": "Sidste ændring",
"toc.title": "Indholdsfortegnelse"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# Suchergebnisse",
"skip.link.title": "Zum Inhalt",
"source.link.title": "Quellcode",
"toc.title": "Inhaltsverzeichnis",
"last.update": "Letztes Update"
"source.revision.date": "Letztes Update",
"toc.title": "Inhaltsverzeichnis"
}[key] }}{% endmacro %}

View File

@ -22,6 +22,6 @@
"search.tokenizer": "[\s\-]+",
"skip.link.title": "Skip to content",
"source.link.title": "Go to repository",
"toc.title": "Table of contents",
"last.update": "Last update"
"source.revision.date": "Last update",
"toc.title": "Table of contents"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# documentos encontrados",
"skip.link.title": "Saltar a contenido",
"source.link.title": "Ir al repositorio",
"toc.title": "Tabla de contenidos",
"last.update": "Última actualización"
"source.revision.date": "Última actualización",
"toc.title": "Tabla de contenidos"
}[key] }}{% endmacro %}

View File

@ -20,6 +20,6 @@
"search.result.other": "Leiti # tulemust",
"skip.link.title": "Keri sisuni",
"source.link.title": "Ava repositooriumis",
"toc.title": "Sisukord",
"last.update": "Viimane uuendus"
"source.revision.date": "Viimane uuendus",
"toc.title": "Sisukord"
}[key] }}{% endmacro %}

View File

@ -21,6 +21,6 @@
"search.result.other": "# سند یافت شد",
"skip.link.title": "پرش به محتویات",
"source.link.title": "رفتن به مخزن",
"toc.title": "فهرست موضوعات",
"last.update": "اخرین بروزرسانی"
"source.revision.date": "اخرین بروزرسانی",
"toc.title": "فهرست موضوعات"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# täsmäävää dokumenttia",
"skip.link.title": "Hyppää sisältöön",
"source.link.title": "Mene repositoryyn",
"toc.title": "Sisällysluettelo",
"last.update": "Viimeisin päivitys"
"source.revision.date": "Viimeisin päivitys",
"toc.title": "Sisällysluettelo"
}[key] }}{% endmacro %}

View File

@ -17,6 +17,6 @@
"search.result.one": "1 document trouvé",
"search.result.other": "# documents trouvés",
"source.link.title": "Aller au dépôt",
"toc.title": "Table des matières",
"last.update": "Dernière mise à jour"
"source.revision.date": "Dernière mise à jour",
"toc.title": "Table des matières"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# resultados atopados",
"skip.link.title": "Ir ao contido",
"source.link.title": "Ir ao repositorio",
"toc.title": "Táboa de contidos",
"last.update": "Última actualización"
"source.revision.date": "Última actualización",
"toc.title": "Táboa de contidos"
}[key] }}{% endmacro %}

View File

@ -20,6 +20,6 @@
"search.result.other": "# αντίστοιχα αρχεία",
"skip.link.title": "Μετάβαση στο περιεχόμενο",
"source.link.title": "Μετάβαση στο αποθετήριο",
"toc.title": "Πίνακας περιεχομένων",
"last.update": "τελευταία ενημέρωση"
"source.revision.date": "τελευταία ενημέρωση",
"toc.title": "Πίνακας περιεχομένων"
}[key] }}{% endmacro %}

View File

@ -21,6 +21,6 @@
"search.result.other": "# מסמך תואם",
"skip.link.title": "דלג לתוכן",
"source.link.title": "עבור אל מאגר",
"toc.title": "תוכן העניינים",
"last.update": "העדכון אחרון"
"source.revision.date": "העדכון אחרון",
"toc.title": "תוכן העניינים"
}[key] }}{% endmacro %}

View File

@ -20,6 +20,6 @@
"search.result.other": "# मिलान डाक्यूमेंट्स",
"skip.link.title": "विषय पर बढ़ें",
"source.link.title": "रिपॉजिटरी पर जाएं",
"toc.title": "विषय - सूची",
"last.update": "आखिरी अपडेट"
"source.revision.date": "आखिरी अपडेट",
"toc.title": "विषय - सूची"
}[key] }}{% endmacro %}

View File

@ -20,6 +20,6 @@
"search.result.other": "# rezultata pretraživanja",
"skip.link.title": "Preskočite na sadržaj",
"source.link.title": "Idite u repozitorij",
"toc.title": "Sadržaj",
"last.update": "Zadnje ažuriranje"
"source.revision.date": "Zadnje ažuriranje",
"toc.title": "Sadržaj"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# egyező dokumentum",
"skip.link.title": "Kihagyás",
"source.link.title": "Főoldalra ugrás",
"toc.title": "Tartalomjegyzék",
"last.update": "Utolsó frissítés"
"source.revision.date": "Utolsó frissítés",
"toc.title": "Tartalomjegyzék"
}[key] }}{% endmacro %}

View File

@ -20,6 +20,6 @@
"search.result.other": "# dokumen ditemukan",
"skip.link.title": "Lewati ke isi",
"source.link.title": "Menuju repositori",
"toc.title": "Daftar isi",
"last.update": "Pembaharuan Terakhir"
"source.revision.date": "Pembaharuan Terakhir",
"toc.title": "Daftar isi"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# documenti trovati",
"skip.link.title": "Vai al contenuto",
"source.link.title": "Apri repository",
"toc.title": "Indice",
"last.update": "Ultimo aggiornamento"
"source.revision.date": "Ultimo aggiornamento",
"toc.title": "Indice"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "#件見つかりました",
"search.tokenizer": "[\s\- 、。,.]+",
"source.link.title": "リポジトリへ",
"toc.title": "目次",
"last.update": "最後の更新"
"source.revision.date": "最後の更新",
"toc.title": "目次"
}[key] }}{% endmacro %}

View File

@ -17,5 +17,6 @@
"search.result.one": "1개의 일치하는 문서",
"search.result.other": "#개의 일치하는 문서",
"source.link.title": "저장소로 이동",
"source.revision.date": "마지막 업데이트",
"toc.title": "목차"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# overeenkomende documenten",
"skip.link.title": "Ga naar inhoud",
"source.link.title": "Ga naar repository",
"toc.title": "Inhoudsopgave",
"last.update": "Laatst geüpdatet op"
"source.revision.date": "Laatst geüpdatet op",
"toc.title": "Inhoudsopgave"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# treff",
"skip.link.title": "Gå til innhald",
"source.link.title": "Gå til kjelde",
"toc.title": "Innhaldsliste",
"last.update": "Siste oppdatering"
"source.revision.date": "Siste oppdatering",
"toc.title": "Innhaldsliste"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# treff",
"skip.link.title": "Gå til innhold",
"source.link.title": "Gå til kilde",
"toc.title": "Innholdsfortegnelse",
"last.update": "Siste oppdatering"
"source.revision.date": "Siste oppdatering",
"toc.title": "Innholdsfortegnelse"
}[key] }}{% endmacro %}

View File

@ -20,6 +20,6 @@
"search.result.other": "Wyniki wyszukiwania: #",
"skip.link.title": "Przejdź do treści",
"source.link.title": "Idź do repozytorium",
"toc.title": "Spis treści",
"last.update": "Ostatnia aktualizacja"
"source.revision.date": "Ostatnia aktualizacja",
"toc.title": "Spis treści"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# resultados encontrados",
"skip.link.title": "Ir para o conteúdo",
"source.link.title": "Ir ao repositório",
"toc.title": "Índice",
"last.update": "Última atualização"
"source.revision.date": "Última atualização",
"toc.title": "Índice"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "Найдено # совпадений",
"skip.link.title": "Перейти к содержанию",
"source.link.title": "Перейти к репозиторию",
"toc.title": "Содержание",
"last.update": "Последнее обновление"
"source.revision.date": "Последнее обновление",
"toc.title": "Содержание"
}[key] }}{% endmacro %}

View File

@ -18,5 +18,6 @@
"search.result.other": "# zadetkov",
"skip.link.title": "Skoči na vsebino",
"source.link.title": "Pojdi na repozitorij",
"source.revision.date": "Zadnja posodobitev",
"toc.title": "Kazalo"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "Vyhovujúce dokumenty: #",
"skip.link.title": "Preskočiť na obsah",
"source.link.title": "Zobraziť repozitár",
"toc.title": "Obsah",
"last.update": "Posledná aktualizácia"
"source.revision.date": "Posledná aktualizácia",
"toc.title": "Obsah"
}[key] }}{% endmacro %}

View File

@ -20,6 +20,6 @@
"search.result.other": "# резултата претраге",
"skip.link.title": "Иди на текст",
"source.link.title": "Иди у репозиторијум",
"toc.title": "Садржај",
"last.update": "Последња исправка"
"source.revision.date": "Последња исправка",
"toc.title": "Садржај"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "# sökresultat",
"skip.link.title": "Gå till innehållet",
"source.link.title": "Gå till datakatalog",
"toc.title": "Innehållsförteckning",
"last.update": "Senaste uppdateringen"
"source.revision.date": "Senaste uppdateringen",
"toc.title": "Innehållsförteckning"
}[key] }}{% endmacro %}

View File

@ -17,6 +17,6 @@
"search.result.one": "1 doküman bulundu",
"search.result.other": "# doküman bulundu",
"source.link.title": "Depoya git",
"toc.title": "İçindekiler",
"last.update": "Son Güncelleme"
"source.revision.date": "Son Güncelleme",
"toc.title": "İçindekiler"
}[key] }}{% endmacro %}

View File

@ -18,6 +18,6 @@
"search.result.other": "Знайдено # збігів",
"skip.link.title": "Перейти до змісту",
"source.link.title": "Перейти до репозиторію",
"toc.title": "Зміст",
"last.update": "Останнє оновлення"
"source.revision.date": "Останнє оновлення",
"toc.title": "Зміст"
}[key] }}{% endmacro %}

View File

@ -17,6 +17,6 @@
"search.result.other": "# tài liệu liên quan",
"skip.link.title": "Vào thẳng nội dung",
"source.link.title": "Đến kho lưu trữ mã nguồn",
"toc.title": "Mục lục",
"last.update": "Cập nhật cuối cùng"
"source.revision.date": "Cập nhật cuối cùng",
"toc.title": "Mục lục"
}[key] }}{% endmacro %}

View File

@ -19,6 +19,6 @@
"search.tokenizer": "[\\。]+",
"skip.link.title": "跳轉至",
"source.link.title": "前往 Github 倉庫",
"toc.title": "目錄",
"last.update": "最後更新"
"source.revision.date": "最後更新",
"toc.title": "目錄"
}[key] }}{% endmacro %}

View File

@ -19,6 +19,6 @@
"search.tokenizer": "[\\。]+",
"skip.link.title": "跳转至",
"source.link.title": "前往 Github 仓库",
"toc.title": "目录",
"last.update": "最后更新"
"source.revision.date": "最后更新",
"toc.title": "目录"
}[key] }}{% endmacro %}

View File

@ -120,7 +120,7 @@ nav:
- Metadata: extensions/metadata.md
- Permalinks: extensions/permalinks.md
- PyMdown: extensions/pymdown.md
- Revision date: extensions/revision_date.md
- Revision date: extensions/revision-date.md
- Specimen: specimen.md
- Customization: customization.md
- Compliance with GDPR: compliance.md

View File

@ -330,17 +330,26 @@
{% endblock %}
<!-- Support for mkdocs-git-revision-date-localized-plugin -->
{% if page.meta.git_revision_date_localized %}
{% if page and page.meta and (
page.meta.git_revision_date_localized or
page.meta.revision_date
) %}
{% set label = lang.t("source.revision.date") %}
<hr />
<div class="md-source-date">
<small>
{{ lang.t('source.revision.date') }}: {{ page.meta.git_revision_date_localized }}
</small>
<!-- Support for mkdocs-git-revision-date-plugin -->
{% elif page.meta.revision_date %}
<small>
{{ lang.t('source.revision.date') }}: {{ page.meta.revision_date }}
</small>
{% endif %}
<!-- mkdocs-git-revision-date-localized-plugin -->
{% if page.meta.git_revision_date_localized %}
{{ label }}: {{ page.meta.git_revision_date_localized }}
<!-- mkdocs-git-revision-date-plugin -->
{% elif page.meta.revision_date %}
{{ label }}: {{ page.meta.revision_date }}
{% endif %}
</small>
</div>
{% endif %}
{% endblock %}
<!-- Disqus integration -->