[GH-3004] Publish sitemaps at documentation language roots - #3309
Merged
Conversation
Member
|
Thanks for the fix. This seems like a lot of code for one missing sitemap. Could we simplify it, especially the test? The current version also fails the Bandit check. |
Contributor
Author
|
Simplified the checks in 583dcb1: removed the 94-line test harness and its separate workflow step. The existing MkDocs build now verifies the XML and gzip sitemap copies with two cmp commands. Bandit 1.9.4 passes with the repository configuration, without suppressions. The full local MkDocs build and both comparisons also pass. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Did you read the Contributor Guide?
Yes, I have read the Contributor Rules and Contributor Development Guide.
Is this PR related to a ticket?
Related to #3004. This addresses the
/latest/zh/sitemap.xml404 shown in the issue's screenshot.What changes were proposed in this PR?
Material requests a sitemap from the Chinese language root, but mkdocs-static-i18n writes the combined sitemap only at the site root. A post-build hook copies the XML and compressed sitemap to each enabled, non-default language root after the nested language builds finish.
The existing documentation build checks both copies with
cmp. No separate test harness or additional dependencies are needed.This fixes language-root requests; handling of contextual alternate links on nested pages is unchanged.
How was this patch tested?
git diff --checkpassed.The local MkDocs build has existing missing generated API documentation/link warnings. Java/Scala/R/Python API documentation builds were not run locally; the previous upstream documentation workflow passed.
Did this PR include necessary documentation updates?
No public API changes. The hook documents its purpose.