Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add last updated for document #11164

Merged
merged 4 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


- uses: actions/setup-python@v5
with:
Expand Down
4 changes: 4 additions & 0 deletions docs/.overrides/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
<meta name="robots" content="index,follow"/>
<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",
"@type": "WebSite",
"name": "Astral Docs",
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ mdformat>=0.7.17
mdformat-mkdocs>=2.0.4
mdformat-admon>=2.0.2
mkdocs-redirects>=1.2.2
mkdocs-git-revision-date-localized-plugin>=1.3.0
15 changes: 14 additions & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# This file was autogenerated by uv via the following command:
# uv pip compile docs/requirements.in -o docs/requirements.txt --universal -p 3.12
babel==2.15.0
# via mkdocs-material
# via
# mkdocs-git-revision-date-localized-plugin
# mkdocs-material
black==24.4.2
# via -r docs/requirements.in
certifi==2024.7.4
Expand All @@ -19,6 +21,10 @@ colorama==0.4.6
# mkdocs-material
ghp-import==2.1.0
# via mkdocs
gitdb==4.0.12
# via gitpython
gitpython==3.1.44
# via mkdocs-git-revision-date-localized-plugin
idna==3.7
# via requests
jinja2==3.1.4
Expand Down Expand Up @@ -72,10 +78,13 @@ mergedeep==1.3.4
mkdocs==1.6.0
# via
# -r docs/requirements.in
# mkdocs-git-revision-date-localized-plugin
# mkdocs-material
# mkdocs-redirects
mkdocs-get-deps==0.2.0
# via mkdocs
mkdocs-git-revision-date-localized-plugin==1.3.0
# via -r docs/requirements.in
mkdocs-material==9.5.29
# via -r docs/requirements.in
mkdocs-material-extensions==1.3.1
Expand Down Expand Up @@ -106,6 +115,8 @@ pymdown-extensions==10.8.1
# via mkdocs-material
python-dateutil==2.9.0.post0
# via ghp-import
pytz==2025.1
# via mkdocs-git-revision-date-localized-plugin
pyyaml==6.0.1
# via
# mkdocs
Expand All @@ -120,6 +131,8 @@ requests==2.32.3
# via mkdocs-material
six==1.16.0
# via python-dateutil
smmap==5.0.2
# via gitdb
uc-micro-py==1.0.3
# via linkify-it-py
urllib3==2.2.2
Expand Down
2 changes: 2 additions & 0 deletions mkdocs.public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ INHERIT: mkdocs.template.yml
# Omit the `typeset` plugin which is only available in the Insiders version.
plugins:
- search
- git-revision-date-localized:
timezone: UTC # It can only be in UTC unless the ISO time can include timezone.
Copy link
Contributor Author

@FishAlchemist FishAlchemist Feb 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I don't want to specifically target UTC(Default UTC), but unfortunately, git_revision_date_localized_raw_iso_datetime doesn't include the timezone offset. So, if you want to change the timezone, you also need to modify the JSON-LD information for Google Search to recognize it.

https://github.com/timvink/mkdocs-git-revision-date-localized-plugin/blob/v1.3.0/src/mkdocs_git_revision_date_localized_plugin/dates.py#L42-L45

"iso_date": loc_revision_date.strftime("%Y-%m-%d"),
"iso_datetime": loc_revision_date.strftime("%Y-%m-%d %H:%M:%S"),

validation:
anchors: warn
watch:
Expand Down
Loading