1
0
mirror of https://github.com/squidfunk/mkdocs-material.git synced 2025-02-17 02:38:38 +01:00

Merge pull request from timvink/master

Add support for git creation date
This commit is contained in:
Martin Donath 2021-05-02 10:57:05 +02:00 committed by GitHub
commit 1bb22efbce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
52 changed files with 163 additions and 48 deletions

@ -39,6 +39,7 @@ assignees: ''
"skip.link.title": "Skip to content",
"source.link.title": "Go to repository",
"source.revision.date": "Last update",
"source.revision.date_created": "Created",
"tabs.title": "Tabs",
"toc.title": "Table of contents"
}[key] }}{% endmacro %}

@ -123,8 +123,8 @@ The following options are supported:
`enabled_if_env`{ #enabled_if_env }
: :octicons-milestone-24: Default: _none_ This option defines whether the
date is actually extracted from git, which makes it possible to disable
: :octicons-milestone-24: Default: _none_ When specified the data will only be extracted from git
if the environment variable exists. This makes it possible to disable
extraction for cases when the repository is not available:
``` yaml
@ -164,9 +164,8 @@ The following options are supported:
`type`{ #type }
: :octicons-milestone-24: Default: `date` This option allows to change the
format of the date to be displayed. Valid values are `date`, `datetime`,
`iso_date`, `iso_datetime` and `timeago`:
: :octicons-milestone-24: Default: `date` The format of the date to be displayed.
Valid values are `date`, `datetime`, `iso_date`, `iso_datetime` and `timeago`:
``` yaml
plugins:
@ -176,8 +175,8 @@ The following options are supported:
`fallback_to_build_date`{ #fallback_to_build_date }
: :octicons-milestone-24: Default: `false` This option specifies whether
the time when `mkdocs build` was executed should be used as a fallback when
: :octicons-milestone-24: Default: `false` Enables falling back to
the time when `mkdocs build` was executed. Can be used as a fallback when
the git repository is not available:
``` yaml
@ -186,6 +185,17 @@ The following options are supported:
fallback_to_build_date: true
```
`enable_creation_date`{ #enable_creation_date }
: :octicons-milestone-24: Default: `false` Enables adding a *Created* date at the bottom of each page.
``` yaml
plugins:
- git-revision-date-localized:
enable_creation_date: true
```
_Material for MkDocs doesn't provide official support for the other options of
this plugin, so they may be supported but might yield unexpected results.
Use them at your own risk._

@ -39,5 +39,7 @@
"skip.link.title": "Slaan oor na inhoud",
"source.link.title": "Slaan oor na inhoud",
"source.revision.date": "Laaste opdatering",
"source.file.date.updated": "Laaste opdatering",
"source.file.date.created": "Geskep",
"toc.title": "Inhoudsopgawe"
}[key] }}{% endmacro %}

@ -40,5 +40,7 @@
"skip.link.title": "انتقل إلى المحتوى",
"source.link.title": "اذهب إلى المصدر",
"source.revision.date": "اخر تحديث",
"source.file.date.updated": "اخر تحديث",
"source.file.date.created": "خلقت",
"toc.title": "جدول المحتويات"
}[key] }}{% endmacro %}

@ -45,6 +45,8 @@
"skip.link.title": "Към съдържанието",
"source.link.title": "Към хранилището",
"source.revision.date": "Последна промяна",
"source.file.date.updated": "Последна промяна",
"source.file.date.created": "Създаден",
"tabs.title": "Табове",
"toc.title": "Съдържание"
}[key] }}{% endmacro %}

@ -43,6 +43,8 @@
"skip.link.title": "কনটেন্টে যান",
"source.link.title": "রিপোজিটরিতে যান",
"source.revision.date": "শেষ আপডেট",
"source.file.date.updated": "শেষ আপডেট",
"source.file.date.created": "তৈরি হয়েছে",
"tabs.title": "ট্যাব",
"toc.title": "টেবিল অফ কনটেন্ট"
}[key] }}{% endmacro %}

@ -38,5 +38,7 @@
"skip.link.title": "Salta el contingut",
"source.link.title": "Ves al repositori",
"source.revision.date": "Darrera actualització",
"source.file.date.updated": "Darrera actualització",
"source.file.date.created": "Creada",
"toc.title": "Taula de continguts"
}[key] }}{% endmacro %}

@ -38,5 +38,7 @@
"skip.link.title": "Přeskočit obsah",
"source.link.title": "Přejít do repozitáře",
"source.revision.date": "Poslední aktualizace",
"source.file.date.updated": "Poslední aktualizace",
"source.file.date.created": "Vytvořeno",
"toc.title": "Obsah"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Gå til indholdet",
"source.link.title": "Åbn arkiv",
"source.revision.date": "Sidste ændring",
"source.file.date.updated": "Sidste ændring",
"source.file.date.created": "Oprettet",
"toc.title": "Indholdsfortegnelse"
}[key] }}{% endmacro %}

@ -43,5 +43,7 @@
"skip.link.title": "Zum Inhalt",
"source.link.title": "Quellcode",
"source.revision.date": "Letztes Update",
"source.file.date.updated": "Letztes Update",
"source.file.date.created": "Erstellt",
"toc.title": "Inhaltsverzeichnis"
}[key] }}{% endmacro %}

@ -50,6 +50,8 @@
"skip.link.title": "Skip to content",
"source.link.title": "Go to repository",
"source.revision.date": "Last update",
"source.file.date.updated": "Last update",
"source.file.date.created": "Created",
"tabs.title": "Tabs",
"toc.title": "Table of contents"
}[key] }}{% endmacro %}

@ -43,6 +43,8 @@
"skip.link.title": "Saltu al enhavo",
"source.link.title": "Iru al deponejo",
"source.revision.date": "Lasta ĝisdatigo",
"source.file.date.updated": "Lasta ĝisdatigo",
"source.file.date.created": "Kreita",
"tabs.title": "Langetoj",
"toc.title": "Enhavtabelo"
}[key] }}{% endmacro %}

@ -47,6 +47,8 @@
"skip.link.title": "Saltar a contenido",
"source.link.title": "Ir al repositorio",
"source.revision.date": "Última actualización",
"source.file.date.updated": "Última actualización",
"source.file.date.created": "Created",
"tabs.title": "Pestañas",
"toc.title": "Tabla de contenidos"
}[key] }}{% endmacro %}

@ -38,5 +38,7 @@
"skip.link.title": "Keri sisuni",
"source.link.title": "Ava repositooriumis",
"source.revision.date": "Viimane uuendus",
"source.file.date.updated": "Viimane uuendus",
"source.file.date.created": "Loodud",
"toc.title": "Sisukord"
}[key] }}{% endmacro %}

@ -40,5 +40,7 @@
"skip.link.title": "پرش به محتویات",
"source.link.title": "رفتن به مخزن",
"source.revision.date": "اخرین بروزرسانی",
"source.file.date.updated": "اخرین بروزرسانی",
"source.file.date.created": "ایجاد شده",
"toc.title": "فهرست موضوعات"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Hyppää sisältöön",
"source.link.title": "Mene repositoryyn",
"source.revision.date": "Viimeisin päivitys",
"source.file.date.updated": "Viimeisin päivitys",
"source.file.date.created": "Luotu",
"toc.title": "Sisällysluettelo"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Aller au contenu",
"source.link.title": "Aller au dépôt",
"source.revision.date": "Dernière mise à jour",
"source.file.date.updated": "Dernière mise à jour",
"source.file.date.created": "Créé",
"toc.title": "Table des matières"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Ir ao contido",
"source.link.title": "Ir ao repositorio",
"source.revision.date": "Última actualización",
"source.file.date.updated": "Última actualización",
"source.file.date.created": "Creada",
"toc.title": "Táboa de contidos"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Μετάβαση στο περιεχόμενο",
"source.link.title": "Μετάβαση στο αποθετήριο",
"source.revision.date": "τελευταία ενημέρωση",
"source.file.date.updated": "τελευταία ενημέρωση",
"source.file.date.created": "Δημιουργήθηκε",
"toc.title": "Πίνακας περιεχομένων"
}[key] }}{% endmacro %}

@ -40,5 +40,7 @@
"skip.link.title": "דלג לתוכן",
"source.link.title": "עבור אל מאגר",
"source.revision.date": "העדכון אחרון",
"source.file.date.updated": "העדכון אחרון",
"source.file.date.created": "נוצר",
"toc.title": "תוכן העניינים"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "विषय पर बढ़ें",
"source.link.title": "रिपॉजिटरी पर जाएं",
"source.revision.date": "आखिरी अपडेट",
"source.file.date.updated": "आखिरी अपडेट",
"source.file.date.created": "बनाया था",
"toc.title": "विषय - सूची"
}[key] }}{% endmacro %}

@ -38,5 +38,7 @@
"skip.link.title": "Preskočite na sadržaj",
"source.link.title": "Idite u repozitorij",
"source.revision.date": "Zadnje ažuriranje",
"source.file.date.updated": "Zadnje ažuriranje",
"source.file.date.created": "Stvoreno",
"toc.title": "Sadržaj"
}[key] }}{% endmacro %}

@ -47,6 +47,8 @@
"skip.link.title": "Kihagyás",
"source.link.title": "Főoldalra ugrás",
"source.revision.date": "Utolsó frissítés",
"source.file.date.updated": "Utolsó frissítés",
"source.file.date.created": "Létrehozva",
"tabs.title": "Lapok",
"toc.title": "Tartalomjegyzék"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Lewati ke isi",
"source.link.title": "Menuju repositori",
"source.revision.date": "Pembaharuan Terakhir",
"source.revision.date": "Pembaharuan Terakhir",
"source.file.date.created": "Dibuat",
"toc.title": "Daftar isi"
}[key] }}{% endmacro %}

@ -44,6 +44,8 @@
"skip.link.title": "Hoppa yfir í efni",
"source.link.title": "Fara í gagnahirslu (e. repository)",
"source.revision.date": "Síðasta uppfærsla",
"source.file.date.updated": "Síðasta uppfærsla",
"source.file.date.created": "Búið til",
"tabs.title": "Flipar",
"toc.title": "Efnisyfirlit"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Vai al contenuto",
"source.link.title": "Apri repository",
"source.revision.date": "Ultimo aggiornamento",
"source.file.date.updated": "Ultimo aggiornamento",
"source.file.date.created": "Creata",
"toc.title": "Indice"
}[key] }}{% endmacro %}

@ -49,6 +49,8 @@
"skip.link.title": "コンテンツにスキップ",
"source.link.title": "リポジトリへ",
"source.revision.date": "最終更新日",
"source.file.date.updated": "最終更新日",
"source.file.date.created": "作成した",
"tabs.title": "タブ",
"toc.title": "目次"
}[key] }}{% endmacro %}

@ -43,6 +43,8 @@
"skip.link.title": "კონტენტზე გადასვლა",
"source.link.title": "საცავში გადასვლა",
"source.revision.date": "ბოლო განახლება",
"source.file.date.updated": "ბოლო განახლება",
"source.file.date.created": "შეიქმნა",
"tabs.title": "ტაბები",
"toc.title": "სარჩევი"
}[key] }}{% endmacro %}

@ -38,5 +38,7 @@
"search.result.other": "#개의 일치하는 문서",
"source.link.title": "저장소로 이동",
"source.revision.date": "마지막 업데이트",
"source.file.date.updated": "마지막 업데이트",
"source.file.date.created": "만들어진",
"toc.title": "목차"
}[key] }}{% endmacro %}

@ -43,6 +43,8 @@
"skip.link.title": "မာတိကာ သို့ သွားရန်",
"source.link.title": "repository သို့ သွားရန်",
"source.revision.date": "နောက်ဆုံး ထုတ်ပြန်ချက်",
"source.file.date.updated": "နောက်ဆုံး ထုတ်ပြန်ချက်",
"source.file.date.created": "နေပြည်တော်",
"tabs.title": "တက်များ",
"toc.title": "ပါဝင်အကြောင်းအရာများ"
}[key] }}{% endmacro %}

@ -38,6 +38,8 @@
"search.result.other": "# overeenkomende documenten",
"skip.link.title": "Ga naar inhoud",
"source.link.title": "Ga naar repository",
"source.revision.date": "Laatst geüpdatet op",
"source.revision.date": "Laatst geüpdatet",
"source.file.date.updated": "Laatst geüpdatet",
"source.file.date.created": "Gecreëerd",
"toc.title": "Inhoudsopgave"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Gå til innhald",
"source.link.title": "Gå til kjelde",
"source.revision.date": "Siste oppdatering",
"source.file.date.updated": "Siste oppdatering",
"source.file.date.created": "Laget",
"toc.title": "Innhaldsliste"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Gå til innhold",
"source.link.title": "Gå til kilde",
"source.revision.date": "Siste oppdatering",
"source.file.date.updated": "Siste oppdatering",
"source.file.date.created": "Created",
"toc.title": "Innholdsfortegnelse"
}[key] }}{% endmacro %}

@ -47,6 +47,8 @@
"skip.link.title": "Przejdź do treści",
"source.link.title": "Idź do repozytorium",
"source.revision.date": "Ostatnia aktualizacja",
"source.file.date.updated": "Ostatnia aktualizacja",
"source.file.date.created": "Utworzony",
"tabs.title": "Zakładki",
"toc.title": "Spis treści"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Ir para o conteúdo",
"source.link.title": "Ir ao repositório",
"source.revision.date": "Última atualização",
"source.file.date.updated": "Última atualização",
"source.file.date.created": "Criada",
"toc.title": "Índice"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Sari la conținut",
"source.link.title": "Accesează repository-ul",
"source.revision.date": "Ultima actualizare",
"source.file.date.updated": "Ultima actualizare",
"source.file.date.created": "Creată",
"toc.title": "Cuprins"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Перейти к содержанию",
"source.link.title": "Перейти к репозиторию",
"source.revision.date": "Последнее обновление",
"source.file.date.updated": "Последнее обновление",
"source.file.date.created": "Созданный",
"toc.title": "Содержание"
}[key] }}{% endmacro %}

@ -37,5 +37,7 @@
"search.result.other": "# rezultata pretrage",
"skip.link.title": "Idi na tekst",
"source.link.title": "Idi u repozitorijum",
"source.file.date.updated": "Ажуриран",
"source.file.date.created": "Створено",
"toc.title": "Sadržaj"
}[key] }}{% endmacro %}

@ -45,6 +45,8 @@
"skip.link.title": "අන්තර්ගතය වෙත යන්න",
"source.link.title": "රිපොසිටරියට යන්න",
"source.revision.date": "අවසන් යාවත්කාලීන වීම",
"source.file.date.updated": "අවසන් යාවත්කාලීන වීම",
"source.file.date.created": "ٺاھيو ويو",
"tabs.title": "ටැබ්ස්",
"toc.title": "පටුන"
}[key] }}{% endmacro %}

@ -38,5 +38,7 @@
"skip.link.title": "Preskočiť na obsah",
"source.link.title": "Zobraziť repozitár",
"source.revision.date": "Posledná aktualizácia",
"source.file.date.updated": "Posledná aktualizácia",
"source.file.date.created": "Vytvorené",
"toc.title": "Obsah"
}[key] }}{% endmacro %}

@ -38,5 +38,7 @@
"skip.link.title": "Skoči na vsebino",
"source.link.title": "Pojdi na repozitorij",
"source.revision.date": "Zadnja posodobitev",
"source.file.date.updated": "Zadnja posodobitev",
"source.file.date.created": "Ustvarjeno",
"toc.title": "Kazalo"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Иди на текст",
"source.link.title": "Иди у репозиторијум",
"source.revision.date": "Последња исправка",
"source.file.date.updated": "Последња исправка",
"source.file.date.created": "Створено",
"toc.title": "Садржај"
}[key] }}{% endmacro %}

@ -47,6 +47,8 @@
"skip.link.title": "Gå till innehållet",
"source.link.title": "Gå till datakatalog",
"source.revision.date": "Senaste uppdateringen",
"source.file.date.updated": "Senaste uppdateringen",
"source.file.date.created": "Skapad",
"tabs.title": "Flikar",
"toc.title": "Innehållsförteckning"
}[key] }}{% endmacro %}

@ -38,5 +38,8 @@
"search.result.other": "พบ # เอกสารที่ตรงกัน",
"skip.link.title": "ข้ามไปที่เนื้อหา",
"source.link.title": "ไปที่ Repository",
"source.revision.date": "สร้าง",
"source.file.date.updated": "สร้าง",
"source.file.date.created": "สร้าง",
"toc.title": "สารบัญ"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Ana içeriğe geç",
"source.link.title": "Depoya git",
"source.revision.date": "Son Güncelleme",
"source.file.date.updated": "Son Güncelleme",
"source.file.date.created": "Oluşturuldu",
"toc.title": "İçindekiler"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Перейти до змісту",
"source.link.title": "Перейти до репозиторію",
"source.revision.date": "Останнє оновлення",
"source.file.date.updated": "Останнє оновлення",
"source.file.date.created": "Створено",
"toc.title": "Зміст"
}[key] }}{% endmacro %}

@ -39,5 +39,7 @@
"skip.link.title": "Vào thẳng nội dung",
"source.link.title": "Đến kho lưu trữ mã nguồn",
"source.revision.date": "Cập nhật cuối cùng",
"source.file.date.updated": "Cập nhật cuối cùng",
"source.file.date.created": "Tạo",
"toc.title": "Mục lục"
}[key] }}{% endmacro %}

@ -42,5 +42,7 @@
"skip.link.title": "跳轉至",
"source.link.title": "前往 GitHub 倉庫",
"source.revision.date": "最後更新",
"source.file.date.updated": "最後更新",
"source.file.date.created": "已建立",
"toc.title": "目錄"
}[key] }}{% endmacro %}

@ -42,5 +42,7 @@
"skip.link.title": "跳轉到",
"source.link.title": "前往倉庫",
"source.revision.date": "最後更新",
"source.file.date.updated": "最後更新",
"source.file.date.created": "สร้าง",
"toc.title": "目錄"
}[key] }}{% endmacro %}

@ -42,5 +42,7 @@
"skip.link.title": "跳转至",
"source.link.title": "前往 GitHub 仓库",
"source.revision.date": "最后更新",
"source.file.date.updated": "最后更新",
"source.file.date.created": "已建立",
"toc.title": "目录"
}[key] }}{% endmacro %}

@ -1,40 +1,3 @@
<!--
Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-->
{% import "partials/language.html" as lang with context %}
<!-- Last updated date -->
{% set label = lang.t("source.revision.date") %}
<hr />
<div class="md-source-date">
<small>
<!-- 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>
<!-- Note source-date.html will be replaced by source-file.html in v8-->
{% include "source-file.html" %}

@ -0,0 +1,44 @@
<!--
Copyright (c) 2016-2021 Martin Donath <martin.donath@squidfunk.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
deal in the Software without restriction, including without limitation the
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
-->
{% import "partials/language.html" as lang with context %}
<!-- Last updated date -->
{% set label = lang.t("source.file.date.updated") %}
<hr />
<div class="md-source-date">
<small>
<!-- mkdocs-git-revision-date-localized-plugin -->
{% if page.meta.git_revision_date_localized %}
{{ label }}: {{ page.meta.git_revision_date_localized }}
{% if page.meta.git_creation_date_localized %}
<br />{{ lang.t("source.file.date.created") }}: {{ page.meta.git_creation_date_localized }}
{% endif %}
<!-- mkdocs-git-revision-date-plugin -->
{% elif page.meta.revision_date %}
{{ label }}: {{ page.meta.revision_date }}
{% endif %}
</small>
</div>