mirror of https://github.com/astral-sh/uv
Add ``last updated`` for document (#11164)
## Summary   Display the last document update time, excluding any automatically generated parts of the document, while ensuring that Google can accurately read and recognize the webpage's time. Note that I do not have permission to update ``requirements-insiders.txt`` Google time info * https://developers.google.com/search/blog/2019/03/help-google-search-know-best-date-for * https://developers.google.com/search/docs/appearance/structured-data/article#amp Similar https://github.com/astral-sh/uv/pull/11162 Closes #11148 ## Test Plan uvx --with-requirements docs/requirements.txt -- mkdocs serve -f mkdocs.public.yml --strict  The correct format is actually ``2024-08-08T22:01:08Z``, but Google Search happens to be lenient and accepts this format. 
This commit is contained in:
parent
73e9928d40
commit
49b85d2e65
|
|
@ -26,6 +26,7 @@ jobs:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.ref }}
|
ref: ${{ inputs.ref }}
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: actions/setup-python@v5
|
- uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,10 @@
|
||||||
<meta name="robots" content="index,follow"/>
|
<meta name="robots" content="index,follow"/>
|
||||||
<script type="application/ld+json">
|
<script type="application/ld+json">
|
||||||
{
|
{
|
||||||
|
{% if page and page.meta.git_revision_date_localized_raw_iso_datetime %}
|
||||||
|
"datePublished": "{{ page.meta.git_revision_date_localized_raw_iso_datetime }}Z",
|
||||||
|
"dateModified": "{{ page.meta.git_revision_date_localized_raw_iso_datetime }}Z",
|
||||||
|
{% endif %}
|
||||||
"@context": "https://schema.org",
|
"@context": "https://schema.org",
|
||||||
"@type": "WebSite",
|
"@type": "WebSite",
|
||||||
"name": "Astral Docs",
|
"name": "Astral Docs",
|
||||||
|
|
|
||||||
|
|
@ -6,3 +6,4 @@ mdformat>=0.7.17
|
||||||
mdformat-mkdocs>=2.0.4
|
mdformat-mkdocs>=2.0.4
|
||||||
mdformat-admon>=2.0.2
|
mdformat-admon>=2.0.2
|
||||||
mkdocs-redirects>=1.2.2
|
mkdocs-redirects>=1.2.2
|
||||||
|
mkdocs-git-revision-date-localized-plugin>=1.3.0
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,9 @@
|
||||||
# This file was autogenerated by uv via the following command:
|
# This file was autogenerated by uv via the following command:
|
||||||
# uv pip compile docs/requirements.in -o docs/requirements.txt --universal -p 3.12
|
# uv pip compile docs/requirements.in -o docs/requirements.txt --universal -p 3.12
|
||||||
babel==2.15.0
|
babel==2.15.0
|
||||||
# via mkdocs-material
|
# via
|
||||||
|
# mkdocs-git-revision-date-localized-plugin
|
||||||
|
# mkdocs-material
|
||||||
black==24.4.2
|
black==24.4.2
|
||||||
# via -r docs/requirements.in
|
# via -r docs/requirements.in
|
||||||
certifi==2024.7.4
|
certifi==2024.7.4
|
||||||
|
|
@ -19,6 +21,10 @@ colorama==0.4.6
|
||||||
# mkdocs-material
|
# mkdocs-material
|
||||||
ghp-import==2.1.0
|
ghp-import==2.1.0
|
||||||
# via mkdocs
|
# via mkdocs
|
||||||
|
gitdb==4.0.12
|
||||||
|
# via gitpython
|
||||||
|
gitpython==3.1.44
|
||||||
|
# via mkdocs-git-revision-date-localized-plugin
|
||||||
idna==3.7
|
idna==3.7
|
||||||
# via requests
|
# via requests
|
||||||
jinja2==3.1.4
|
jinja2==3.1.4
|
||||||
|
|
@ -72,10 +78,13 @@ mergedeep==1.3.4
|
||||||
mkdocs==1.6.0
|
mkdocs==1.6.0
|
||||||
# via
|
# via
|
||||||
# -r docs/requirements.in
|
# -r docs/requirements.in
|
||||||
|
# mkdocs-git-revision-date-localized-plugin
|
||||||
# mkdocs-material
|
# mkdocs-material
|
||||||
# mkdocs-redirects
|
# mkdocs-redirects
|
||||||
mkdocs-get-deps==0.2.0
|
mkdocs-get-deps==0.2.0
|
||||||
# via mkdocs
|
# via mkdocs
|
||||||
|
mkdocs-git-revision-date-localized-plugin==1.3.0
|
||||||
|
# via -r docs/requirements.in
|
||||||
mkdocs-material==9.5.29
|
mkdocs-material==9.5.29
|
||||||
# via -r docs/requirements.in
|
# via -r docs/requirements.in
|
||||||
mkdocs-material-extensions==1.3.1
|
mkdocs-material-extensions==1.3.1
|
||||||
|
|
@ -106,6 +115,8 @@ pymdown-extensions==10.8.1
|
||||||
# via mkdocs-material
|
# via mkdocs-material
|
||||||
python-dateutil==2.9.0.post0
|
python-dateutil==2.9.0.post0
|
||||||
# via ghp-import
|
# via ghp-import
|
||||||
|
pytz==2025.1
|
||||||
|
# via mkdocs-git-revision-date-localized-plugin
|
||||||
pyyaml==6.0.1
|
pyyaml==6.0.1
|
||||||
# via
|
# via
|
||||||
# mkdocs
|
# mkdocs
|
||||||
|
|
@ -120,6 +131,8 @@ requests==2.32.3
|
||||||
# via mkdocs-material
|
# via mkdocs-material
|
||||||
six==1.16.0
|
six==1.16.0
|
||||||
# via python-dateutil
|
# via python-dateutil
|
||||||
|
smmap==5.0.2
|
||||||
|
# via gitdb
|
||||||
uc-micro-py==1.0.3
|
uc-micro-py==1.0.3
|
||||||
# via linkify-it-py
|
# via linkify-it-py
|
||||||
urllib3==2.2.2
|
urllib3==2.2.2
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ INHERIT: mkdocs.template.yml
|
||||||
# Omit the `typeset` plugin which is only available in the Insiders version.
|
# Omit the `typeset` plugin which is only available in the Insiders version.
|
||||||
plugins:
|
plugins:
|
||||||
- search
|
- search
|
||||||
|
- git-revision-date-localized:
|
||||||
|
timezone: UTC # It can only be in UTC unless the ISO time can include timezone.
|
||||||
validation:
|
validation:
|
||||||
anchors: warn
|
anchors: warn
|
||||||
watch:
|
watch:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue