Skip to content

📚 Give every sphinx-mounts and sphinx-codelinks docs page its canonical address - #2004

Draft
ubmarco wants to merge 2 commits into
masterfrom
worktree-rtd-canonical-baseurl
Draft

ubmarco wants to merge 2 commits into
masterfrom
worktree-rtd-canonical-baseurl

Conversation

@ubmarco

@ubmarco ubmarco commented Sep 30, 2026

Copy link
Copy Markdown
Member

Read the Docs now serves both docs sites from custom domains, https://sphinx-mounts.useblocks.com and https://codelinks.useblocks.com, and passes every build the address it serves that version from in READTHEDOCS_CANONICAL_URL. Sphinx writes a <link rel="canonical"> into each page from html_baseurl, which neither conf.py set, so no page declared its canonical address. This sets it from the variable in both.

Outside Read the Docs the variable is unset and html_baseurl is empty, which is Sphinx's default, so local builds and CI's docs jobs produce the same output as before.

Verification

  • uv run poe docs-mounts and uv run poe docs-codelinks pass (-nW), with the variable set and without it.
  • With READTHEDOCS_CANONICAL_URL=https://sphinx-mounts.useblocks.com/en/latest/, all 10 content pages carry it, e.g. <link rel="canonical" href="https://sphinx-mounts.useblocks.com/en/latest/motivation.html">. The 11th HTML file in the output is a template that gets copied into _static.
  • With READTHEDOCS_CANONICAL_URL=https://codelinks.useblocks.com/en/latest/, all 18 content pages carry it. Two kinds of page carry none, and this PR doesn't change them: the traced-source pages sphinx-codelinks generates, and sphinx-needs' permalink.html. Both render from their own templates.
  • Without the variable, no page in either site has a canonical link, same as before.
  • uv run poe lint passes.

No changelog entry: nothing in either package changes, only the HTML of their docs sites.

…al address

Read the Docs serves both sites from custom domains now
(sphinx-mounts.useblocks.com, codelinks.useblocks.com) and passes every build
the address it serves that version from in READTHEDOCS_CANONICAL_URL. Sphinx
writes a <link rel="canonical"> into each page from html_baseurl, which neither
conf.py set, so no page declared its address. Set it from the variable.

Outside Read the Docs the variable is unset, html_baseurl is empty (Sphinx's
default), and the output is unchanged.
@github-actions github-actions Bot added pkg: sphinx-mounts Concerns the sphinx-mounts package (packages/sphinx-mounts) pkg: sphinx-codelinks Concerns the sphinx-codelinks package (packages/sphinx-codelinks) labels Sep 30, 2026
@codecov

codecov Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.76%. Comparing base (d68d10d) to head (be22f65).
⚠️ Report is 30 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2004      +/-   ##
==========================================
+ Coverage   91.69%   91.76%   +0.06%     
==========================================
  Files         129      129              
  Lines       18155    18111      -44     
==========================================
- Hits        16648    16619      -29     
+ Misses       1507     1492      -15     
Flag Coverage Δ
codelinks 93.42% <ø> (ø)
mounts 94.26% <ø> (+0.24%) ⬆️
pytests 91.48% <ø> (+0.07%) ⬆️
reports 88.55% <ø> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

codelinks.useblocks.com points at Read the Docs now, which builds the docs from
this repository. The bullet no longer says "nothing changes for a reader of that
URL": links into the old, unversioned GitHub Pages site (/basics/installation.html)
404 until the project gets a redirect or the single-version URL scheme.
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 sphinx-codelinks | 🛠️ Build #34863057 | 📁 Comparing be22f65 against latest (d0edd0e)

  🔍 Preview build  

1 file changed
± changelog.html

This branch has not been deployed

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

Labels

pkg: sphinx-codelinks Concerns the sphinx-codelinks package (packages/sphinx-codelinks) pkg: sphinx-mounts Concerns the sphinx-mounts package (packages/sphinx-mounts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant