Skip to content

docs: Make edit links and sitemap independent of the site generator - #7938

Open
petrasovaa wants to merge 1 commit into
OSGeo:mainfrom
petrasovaa:main
Open

petrasovaa wants to merge 1 commit into
OSGeo:mainfrom
petrasovaa:main

Conversation

@petrasovaa

Copy link
Copy Markdown
Contributor

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.py writes the GitHub edit URL of the page source into the front matter (source_edit_url). The actions.html override reads it from page.meta, so the hook_list_scripts.py hook, which scraped the URL from the "Available at" links, is removed together with its copy rules in the Makefile and CMake.
  • New utils/generate_sitemap.py writes sitemap.xml from 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.
  • Tests for both in 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.

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.
@github-actions github-actions Bot added CI Continuous integration Python Related code is in Python HTML Related code is in HTML docs tests Related to Test Suite CMake labels Sep 23, 2026
Comment thread utils/generate_sitemap.py
import argparse
import datetime
from pathlib import Path
from xml.sax.saxutils import escape
@cwhite911

Copy link
Copy Markdown
Contributor

I want to check the new artifact to make sure it conforms to all the SEO updates.

@echoix

echoix commented Oct 4, 2026

Copy link
Copy Markdown
Member

I want to check the new artifact to make sure it conforms to all the SEO updates.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous integration CMake docs HTML Related code is in HTML Python Related code is in Python tests Related to Test Suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants