Skip to content

Fix broken sitemap and canonical URLs in docs - #263

Merged
necessarylion merged 2 commits into
mainfrom
fix/docs-sitemap-urls
Oct 26, 2026
Merged

necessarylion merged 2 commits into
mainfrom
fix/docs-sitemap-urls

Conversation

@necessarylion

@necessarylion necessarylion commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Problem

All 101 links in https://dartondox.dev/latest/sitemap.xml give a 404, for example https://dartondox.dev/latest/3.x/. The canonical link on every page has the same wrong path. So search engines are sent to pages that do not exist.

Cause

site_url ended in /latest/. mike adds the version folder on top, so URLs became /latest/3.x/....

Fix

  • site_url is now the site root: https://dartondox.dev/.

  • The mike plugin has canonical_version: latest, so the sitemap and canonical links use /latest/....

  • The sitemap is now also at https://dartondox.dev/sitemap.xml. `ci/docs_redirects.py` copies it from `/latest/` to the site root, and `robots.txt` points to it.

Checked

  • Local mike deploy into a throwaway branch: sitemap and canonical links are https://dartondox.dev/latest/....

  • mkdocs build --strict passes.

  • Ran `ci/docs_redirects.py` on a fake gh-pages folder: it writes `/sitemap.xml`, and `robots.txt` points to it.

All sitemap links and page canonical links pointed to /latest/3.x/,
which is a 404. site_url ended in /latest/ and mike added the version
folder on top. Now site_url is the site root and mike uses
canonical_version: latest.
@necessarylion
necessarylion merged commit dc0f0e4 into main Oct 26, 2026
7 checks passed
@necessarylion
necessarylion deleted the fix/docs-sitemap-urls branch October 26, 2026 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant