From 452cccbb1e2c34437dc3d7dd450992aaaa22d27b Mon Sep 17 00:00:00 2001 From: Marco Heinemann Date: Wed, 30 Sep 2026 23:31:35 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=93=9A=20Give=20every=20sphinx-mounts?= =?UTF-8?q?=20and=20sphinx-codelinks=20docs=20page=20its=20canonical=20add?= =?UTF-8?q?ress?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 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. --- packages/sphinx-codelinks/docs/conf.py | 5 +++++ packages/sphinx-mounts/docs/conf.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/packages/sphinx-codelinks/docs/conf.py b/packages/sphinx-codelinks/docs/conf.py index 5500c3be7..152b087b7 100644 --- a/packages/sphinx-codelinks/docs/conf.py +++ b/packages/sphinx-codelinks/docs/conf.py @@ -6,6 +6,7 @@ # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information +import os import tomllib from datetime import datetime from pathlib import Path @@ -82,6 +83,10 @@ } html_context = {"repository": "useblocks/sphinx-needs"} html_css_files = ["furo.css"] +# Read the Docs passes every build the address it serves that version from, custom domain +# included, and Sphinx writes a `` into every page from it. Outside +# Read the Docs the variable is unset, and an empty base URL writes no canonical link. +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") # Sphinx-Needs configuration needs_from_toml = "ubproject.toml" diff --git a/packages/sphinx-mounts/docs/conf.py b/packages/sphinx-mounts/docs/conf.py index 7f99c1ace..0377fbc0d 100644 --- a/packages/sphinx-mounts/docs/conf.py +++ b/packages/sphinx-mounts/docs/conf.py @@ -1,5 +1,6 @@ """Sphinx configuration for the sphinx-mounts docs.""" +import os import tomllib from datetime import datetime from pathlib import Path @@ -54,6 +55,10 @@ } html_context = {"repository": "useblocks/sphinx-needs"} html_css_files = ["furo.css"] +# Read the Docs passes every build the address it serves that version from, custom domain +# included, and Sphinx writes a `` into every page from it. Outside +# Read the Docs the variable is unset, and an empty base URL writes no canonical link. +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") # Named hyperlink targets for sibling useblocks projects. Defined once # here (appended to every RST source via ``rst_epilog``) so the URLs are From be22f65e144b87fd7c152db818d7766fee05f52d Mon Sep 17 00:00:00 2001 From: Marco Heinemann Date: Wed, 30 Sep 2026 23:54:42 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=93=9A=20sphinx-codelinks=20changelog?= =?UTF-8?q?:=20the=20documentation=20move=20is=20done?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- packages/sphinx-codelinks/docs/changelog.rst | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/sphinx-codelinks/docs/changelog.rst b/packages/sphinx-codelinks/docs/changelog.rst index 21fac1dcf..f0b883e9b 100644 --- a/packages/sphinx-codelinks/docs/changelog.rst +++ b/packages/sphinx-codelinks/docs/changelog.rst @@ -28,10 +28,8 @@ New and Improved *Package* dropdown with ``sphinx-codelinks`` among its options, and issues and pull requests concerning this package get a ``pkg: sphinx-codelinks`` label. Old issue URLs redirect. - - **The documentation** (in progress): https://codelinks.useblocks.com stays the address. - It is served by GitHub Pages from the old repository until the Read the Docs project - and the DNS move are done, and by Read the Docs afterwards; nothing changes for a - reader of that URL. + - **The documentation** (done): https://codelinks.useblocks.com stays the address, and + Read the Docs now builds and serves it from this repository. - **The old repository** will be archived rather than deleted, so every permalink and every ``git+https://…/sphinx-codelinks.git@`` pin keeps resolving. Repositories pinning ``@main`` will stop receiving updates and should re-point at PyPI or at