Repository navigation
docs: Make edit links and sitemap independent of the site generator - #7938
Open
petrasovaa wants to merge 1 commit into
Open
petrasovaa wants to merge 1 commit into
petrasovaa wants to merge 1 commit into
Conversation
Write the GitHub edit URL of each page into its front matter in mkmarkdown.py and read it in the actions template, replacing the MkDocs hook which scraped it from the rendered pages. Add generate_sitemap.py which lists every built page, and run it in the documentation workflow so pages outside the navigation stay in the sitemap. Written with Claude Code.
| import argparse | ||
| import datetime | ||
| from pathlib import Path | ||
| from xml.sax.saxutils import escape |
Contributor
|
I want to check the new artifact to make sure it conforms to all the SEO updates. |
echoix
approved these changes
Oct 4, 2026
Member
Do the new artifacts work? The artifacts are kept 15 days, if it ends up being later, a PR update or a rerun would bring up fresh artifacts. |
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.
Prepares the manual build for Zensical, which has no Python hooks and lists only navigation pages in its sitemap. Both changes also work with the current MkDocs build and produce the same result, so this PR does not switch the generator yet.
This PR can be merged now, but the complete switch to zensical might be better done in November: https://zensical.org/upcoming-changes/
This PR contains:
utils/mkmarkdown.pywrites the GitHub edit URL of the page source into the front matter (source_edit_url). Theactions.htmloverride reads it frompage.meta, so thehook_list_scripts.pyhook, which scraped the URL from the "Available at" links, is removed together with its copy rules in the Makefile and CMake.utils/generate_sitemap.pywritessitemap.xmlfrom the built HTML pages. The documentation workflow runs it after the site build and before libpython is moved in, so the existing merge step is unchanged.utils/tests/.Verified by building the full site with MkDocs Material and with Zensical: edit and view links are identical to the previous hook output, and the generated sitemap has the same 739 URLs as the one MkDocs writes.
Written with Claude Code.