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 ![image](https://github.com/user-attachments/assets/75431f9f-debe-435d-a02e-d216be7a3a01) ![image](https://github.com/user-attachments/assets/2d1b895e-4878-410e-90ff-ff8e932cbf24) 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 ![image](https://github.com/user-attachments/assets/6e8cd609-2e60-489c-97cc-fb28aa3204e0) The correct format is actually ``2024-08-08T22:01:08Z``, but Google Search happens to be lenient and accepts this format. ![image](https://github.com/user-attachments/assets/2ec8ce98-49ea-403b-bbd2-3d0d5630a562) --- .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 @@