Skip to content

Backport libpython docs canonical, sitemap, and noindex fixes to 8.5 - #7784

Merged
cwhite911 merged 5 commits into
OSGeo:releasebranch_8_5from
cwhite911:backport-seo-docs-8.5
Jul 28, 2026
Merged

cwhite911 merged 5 commits into
OSGeo:releasebranch_8_5from
cwhite911:backport-seo-docs-8.5

Conversation

@cwhite911

Copy link
Copy Markdown
Contributor

What

Backport of the libpython/manuals SEO pipeline to releasebranch_8_5, which builds the published grass-stable docs. Cherry-picks (-x) of the five merged PRs, in merge order:

Why

The grass-stable docs are built from this branch and are currently broken: libpython canonicals point at grass-devel and the merged sitemap locs are grass8.5.1dev/... (404), because #7760 only landed on main. This restores the correct grass-stable canonical and sitemap here.

#7772 and #7782 are backported together on purpose: #7772 alone gated noindex on MICRO == *dev, and this branch is 8.5.1dev, so it would have wrongly set grass-stable to noindex. #7782's !startsWith(github.ref_name, 'releasebranch_') gate resolves to indexed on releasebranch_8_5, which is the intended behavior.

Conflicts

Only #7740 conflicted (this branch predates its conf.py restructure); resolved in doc/python_intro.md by taking the grass-namespace links. The other four applied cleanly on top.

Verification

  • conf.py compiles; single html_baseurl = .../grass-stable/manuals/libpython/; sitemap_url_scheme = "{link}".
  • utils/test_merge_sitemaps.py passes (5).
  • Note: this PR's CI runs on a PR ref, so GRASS_DOCS_NOINDEX resolves to true and the PR artifact will show noindex on stable pages. That is expected for a PR build and is NOT how the deployed branch behaves; the real releasebranch_8_5 push build (ref starts with releasebranch_) resolves to indexed. Verify the canonical + sitemap fixes from the artifact, and the indexed behavior on the post-merge branch build.

Once merged, the backport to 8.5 label can be removed from the source PRs.

wenzeslaus and others added 5 commits July 27, 2026 15:11
…eo#7740)

The Sphinx build of the Python library documented every subpackage
twice: once under a stripped namespace (pygrass, script, temporal, ...)
and once under the full, preferred one (grass.pygrass, grass.script,
...). Keep only the grass.* pages.

Drop the seven per-subpackage sphinx-apidoc runs and the sys.path
entries in conf.py that made the modules importable under their stripped
names, and point the handwritten pages, the theme navigation and the
links in doc/ at the grass.* pages and modules.

This removes 22 of the 42 Sphinx warnings. All ten "more than one target
found for cross-reference" warnings (Table, GrassTestFilesMultiReporter)
are gone, since they were caused purely by the duplicate generation, as
are the docstring warnings which were reported once per spelling.

The three remaining "duplicate object description" warnings (Module,
MultiModule, ParallelModuleQueue) are not caused by the stripped
namespace: grass.pygrass.modules re-exports these classes, so autodoc
documents them both on the package page and on the page of the module
defining them. They are left for a separate change.

This change was prepared with the assistance of Claude Code.

(cherry picked from commit 0b25cf0)
…OSGeo#7760)

* docs: Fix libpython canonical and sitemap URLs (OSGeo#5935)

conf.py set html_baseurl twice. The second assignment (the bare domain root,
added for sphinx-sitemap) overwrote the canonical base, so every libpython page
emitted a bare-root canonical, and the sitemap scheme injected the full dev
version (grass8.6.0dev), producing 404 URLs.

Use a single html_baseurl built from the short numbered prefix
(https://grass.osgeo.org/grass<MAJOR><MINOR>/manuals/libpython/) and set the
sitemap scheme to "{link}", so canonical and sitemap URLs are identical and
resolve to the published grass86 tree.

Make merge_sitemaps.py preserve each source sitemap's URLs by default (the
--version rewrite is now opt-in) and drop the --version override in
documentation.yml, so the merged manuals sitemap keeps grass-stable manuals and
grass86 libpython URLs. Add a unit test for check_url_version.

Drafted with AI assistance.

* docs: Use grass-stable canonical for libpython to match core manuals

Per review feedback (OSGeo#7760): keep the stable manuals tree as the
absolute canonical base instead of the numbered grassMAJORMINOR tree. This
matches the MkDocs core manuals (site_url = .../grass-stable/manuals/) so the
merged sitemap is uniformly grass-stable, and leaves dev-URL rewriting to CI.

(cherry picked from commit 67a183c)
…o#7772)

* docs: noindex development manuals so they defer to grass-stable

Dev builds (VERSION micro ends in 'dev') publish under grass-devel/grass86 with
pages near-identical to grass-stable. They all canonicalize to grass-stable
(see OSGeo#5935), but dev-only pages have no stable equivalent to canonicalize to, so
canonical alone can leave them indexed. Emit 'noindex, follow' on dev builds for
both generators:

- MkDocs: new overrides/main.html gated on extra.noindex, fed by GRASS_DOCS_NOINDEX
  which documentation.yml sets to true when MICRO ends in 'dev'.
- Sphinx: conf.py sets grass_noindex from the version and passes it via html_context
  to layout.html.template.

Stable and release builds leave the flag off and stay indexable.

* docs: fix MkDocs noindex flag on dev builds

mkdocs !ENV coerces the value to a boolean, so the == "true" test never matched.

* man: install mkdocs overrides/main.html into the docs dir

The build copies mkdocs files individually, so the new override was missing
from MKDOCS_DIR and dev pages got no noindex.

(cherry picked from commit 0163d24)
)

CI: drop libpython sitemap after merging into the manuals sitemap

Its URLs are already in the merged sitemap; remove it so each URL is listed once.

(cherry picked from commit 8ff9ef6)
@github-actions github-actions Bot added CI Continuous integration Python Related code is in Python HTML Related code is in HTML libraries docs markdown Related to markdown, markdown files notebook labels Jul 27, 2026
@cwhite911 cwhite911 self-assigned this Jul 27, 2026
@neteler neteler added this to the 8.5.1 milestone Jul 28, 2026

@neteler neteler left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While I cannot fully judge this PR - let's try!

@cwhite911
cwhite911 merged commit e29a15d into OSGeo:releasebranch_8_5 Jul 28, 2026
25 of 26 checks passed
@cwhite911

Copy link
Copy Markdown
Contributor Author

Was the OSGeo4w failure expected?

https://github.com/OSGeo/grass/actions/runs/30376461516

@echoix

echoix commented Jul 28, 2026

Copy link
Copy Markdown
Member

Was the OSGeo4w failure expected?

https://github.com/OSGeo/grass/actions/runs/30376461516

Yes they all fail there, since they don’t exist on the hardcoded server

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

Labels

CI Continuous integration docs HTML Related code is in HTML libraries markdown Related to markdown, markdown files notebook Python Related code is in Python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants