From 49b85d2e65f82411b76d6ef3a68b3c20fad197f6 Mon Sep 17 00:00:00 2001
From: FishAlchemist <48265002+FishAlchemist@users.noreply.github.com>
Date: Tue, 4 Feb 2025 11:28:47 +0800
Subject: [PATCH] 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.

---
.github/workflows/publish-docs.yml | 1 +
docs/.overrides/main.html | 4 ++++
docs/requirements.in | 1 +
docs/requirements.txt | 15 ++++++++++++++-
mkdocs.public.yml | 2 ++
5 files changed, 22 insertions(+), 1 deletion(-)
diff --git a/.github/workflows/publish-docs.yml b/.github/workflows/publish-docs.yml
index 85900bda6..5a8993a7a 100644
--- a/.github/workflows/publish-docs.yml
+++ b/.github/workflows/publish-docs.yml
@@ -26,6 +26,7 @@ jobs:
- uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
+ fetch-depth: 0
- uses: actions/setup-python@v5
with:
diff --git a/docs/.overrides/main.html b/docs/.overrides/main.html
index 07cd6bc02..774eb6d2c 100644
--- a/docs/.overrides/main.html
+++ b/docs/.overrides/main.html
@@ -21,6 +21,10 @@