Skip to content

feat: better canonical URL support#462

Merged
SecondSkoll merged 5 commits into
mainfrom
fix-rtd-canonical-url
Nov 5, 2025
Merged

feat: better canonical URL support#462
SecondSkoll merged 5 commits into
mainfrom
fix-rtd-canonical-url

Conversation

@SecondSkoll

@SecondSkoll SecondSkoll commented Nov 2, 2025

Copy link
Copy Markdown
Collaborator
  • Have you updated CHANGELOG.md with relevant non-documentation file changes?
  • Have you updated the documentation for this change?

To support canonical URLs properly, the html_baseurl needs to be set to the default version's versioned URL, which can be provided by RTD's config variables. Otherwise the Canonical URL is broken in any doc using anything save for the single unversioned URL option.

Also preps for a release.

@SecondSkoll SecondSkoll marked this pull request as ready for review November 2, 2025 11:36

@medubelko medubelko left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Code LGTM, added some questions about the changelog.

Comment thread CHANGELOG.md Outdated
Comment thread CHANGELOG.md Outdated
@SecondSkoll SecondSkoll merged commit 6ebe09f into main Nov 5, 2025
7 checks passed
@SecondSkoll SecondSkoll deleted the fix-rtd-canonical-url branch November 5, 2025 11:11
SecondSkoll added a commit that referenced this pull request Nov 13, 2025
* fix: CLA check to run on PRs only

* refactor: Replace build_metrics.sh with something nicer (#373)

* Replace build_metrics.sh with something nicer

* docs: update changelog

* docs: fix info about setting RTD key as GitHub deploy key (#423)

* fix: spelling mistake in update script (#425)

* fix spelling mistake in update script

* add change to CHANGELOG.md

* Add warning to set-up-automated-testing.rst (#427)

* feat: exclude generated pages from sitemap by default, document wildcards (#429)

* add info about wildcard excludes

* add placeholder sitemap_excludes in conf.py

* adjust wording of comment

* enable typical sitemap_excludes by default

* use consistent wording and formatting

* Use long parameter for 'fail on warning' (#430)

* docs: add troubleshooting how-to (#432)

Add tag desync as the first issue.

* Fix stale references to `custom_conf.py` (#433)

* fix(ci): make check-removed-urls work with private forks (#437)

* fix(ci): make check-removed-urls work with private forks

Fixes #436

* docs: update changelog

* chore: add `CODEOWNERS` (#439)

* chore: add `CODEOWNERS`

Enumerate individual reviewers for now.

Later, we can add a Sphinx development team, once we've established one.

* docs: add #438 to changelog

* chore: missing hyphen

Co-authored-by: Michael Park <michael.park@canonical.com>

* chore: revert changelog entry

Co-authored-by: Michael Park <michael.park@canonical.com>

---------

Co-authored-by: Michael Park <michael.park@canonical.com>

* Update Open Graph image URL in conf.py (#441)

The preview image being used was an old one, and the design team has suggested the use of this one instead.

* Update workflow action versions (#445)

* update workflow action versions

* update changelog

* Update CHANGELOG.md

Co-authored-by: Dave Wilding <david.wilding@canonical.com>

---------

Co-authored-by: Dave Wilding <david.wilding@canonical.com>

* Fix whitespace and executable flag of scripts (#448)

* make scripts executable

* remove whitespace from vale script

* update CHANGELOG.md

* docs: add how-to guide for Mermaid diagramming tool (#442)

Signed-off-by: annecyh <anne.chew@canonical.com>

* Move from canonical-sphinx-exensions to individual packages (#449)

* Move from canonical-sphinx-exensions to individual packages

* Update CHANGELOG.md

* build(deps): bump sphinx-terminal to v0.1.1 (#454)

* docs: add how-to guide for sphinx autodoc extension (#450)

* docs: update how to index.rst add autodocs

* docs: create autodocs.md

* fix: conf file formatting in autodocs.md

* fix: fix conf.py formatting in autodocs.md

* fix: pr comment updates

* fix: requested pr changes

Signed-off-by: Ashley Cliff <ashley.cliff@canonical.com>

* fix: autodoc table formatting

Signed-off-by: Ashley Cliff <ashley.cliff@canonical.com>

* docs: update changelog for autodoc

Signed-off-by: Ashley Cliff <ashley.cliff@canonical.com>

* fix: autodoc spell fix

Signed-off-by: Ashley Cliff <ashley.cliff@canonical.com>

* fix: autodoc formatting

Signed-off-by: Ashley Cliff <ashley.cliff@canonical.com>

---------

Signed-off-by: Ashley Cliff <ashley.cliff@canonical.com>

* build: move Vale dependencies to requirements.txt (#456)

* move Vale dependencies to requirements.txt

* add PR link to CHANGELOG.md

* Add OpenAPI how-to guide (#446)

* Add OpenAPI how-to guide

* Include RTD steps in OpenAPI how-to guide

* docs: add guidelines for using custom base templates (#455)

* docs: add guidelines for using custom base templates

Signed-off-by: annecyh <anne.chew@canonical.com>

* docs: add a how-to guide for data tables (#451)

* add first draft of data tables guide

* add data tables guide to index

* add details about Sphinx DataTables

* adjust wording

* update landing page per suggestion

* adjust wording

* mention new doc in CHANGELOG

* remove full stop

* put links in alphabetical order

* use reST formatting

* explain purpose of links and remove duplicated links

* improve wording per review

* docs: consolidate custom template information (#459)

Signed-off-by: annecyh <anne.chew@canonical.com>

* Details about sphinx-terminal (#447)

* Details about sphinx-terminal

* Describe the terminal copy button

Co-authored-by: JJ Coldiron <jj.coldiron@canonical.com>

* fix(build): remove em dash from fallback target (#461)

 #388 introduced an emdash in the makefile that was almost certainly not
intended; this causes the fallthrough case to infinitely recurse.

---------

Signed-off-by: Wesley Hershberger <wesley.hershberger@gmail.com>
Co-authored-by: Michael DuBelko <michael.dubelko@gmail.com>

* feat!: incorporate redesigned terminal (#460)

* fix(docs): update style guide redirects (#453)

* docs: add step to remove CODEOWNERS in the tutorial (#458)

Reorganise the first two sections so copying and pruning files are
discrete actions.

* Ensure update_sp.py is executable from any directory not just docs/ (#424)

* ensure this file is executable from any directory not just docs/

* Add a new line

* update requirements.txt path

* update NEWFILES.txt path

* chore: refactor makefile (#426)

Co-authored-by: Michael Park <michael.park@canonical.com>

* chore: Remove `ALLFILES` from makefile (#434)

* Remove `ALLFILES` from Makefile

* Update changelog

---------

Co-authored-by: Michael Park <michael.park@canonical.com>

* feat: better canonical URL support (#462)

* fix: config for canonical URL

* docs: update html_baseurl context in conf file

* Update CHANGELOG.md

* Update CHANGELOG.md

* chore: reword changelog entry

* chore: bump version

* fix: CHANGELOG

* fix: spelling issues

---------

Signed-off-by: annecyh <anne.chew@canonical.com>
Signed-off-by: Ashley Cliff <ashley.cliff@canonical.com>
Signed-off-by: Wesley Hershberger <wesley.hershberger@gmail.com>
Co-authored-by: Dave Jones <dave@waveform.org.uk>
Co-authored-by: Dave Wilding <david.wilding@canonical.com>
Co-authored-by: Erin Conley <erin.conley@canonical.com>
Co-authored-by: Robert Krátký <robert.kratky@canonical.com>
Co-authored-by: Michael DuBelko <michael.dubelko@canonical.com>
Co-authored-by: tarek-y-ismail <tarek.ismail@canonical.com>
Co-authored-by: Alex Lowe <alex.lowe@canonical.com>
Co-authored-by: Dimple Kuriakose <123362247+k-dimple@users.noreply.github.com>
Co-authored-by: AnneCYH <anne.chew@canonical.com>
Co-authored-by: Artem Konev <141050460+akcano@users.noreply.github.com>
Co-authored-by: JJ Coldiron <jj.coldiron@canonical.com>
Co-authored-by: Ashley Cliff <ashley.cliff@canonical.com>
Co-authored-by: Marek Suchánek <marek.suchanek@canonical.com>
Co-authored-by: Wesley Hershberger <wesley.hershberger@canonical.com>
Co-authored-by: Michael DuBelko <michael.dubelko@gmail.com>
Co-authored-by: Charles Uneze <charlesniklaus@gmail.com>
minaelee pushed a commit to minaelee/sphinx-docs-starter-pack that referenced this pull request Dec 4, 2025
PR canonical#462 introduced fetching the canonical URL from a RTD environment
variable. In versioned docs, this URL includes the version, which means
that the previous logic to set the sitemap_url_scheme is no longer
necessary and duplicates the version (e.g., "../latest/latest/.."). This
fix removes the duplication.

Since the html_baseurl value falls back to "/", there is also no need
to set a separate sitemap_url_scheme for local builds.

Signed-off-by: Minae Lee <minae.lee@canonical.com>
@minaelee minaelee mentioned this pull request Dec 4, 2025
2 tasks
minaelee pushed a commit that referenced this pull request Dec 10, 2025
* fix: remove redundancy in sitemap_url_scheme

PR #462 introduced fetching the canonical URL from a RTD environment
variable. In versioned docs, this URL includes the version, which means
that the previous logic to set the sitemap_url_scheme is no longer
necessary and duplicates the version (e.g., "../latest/latest/.."). This
fix removes the duplication.

Since the html_baseurl value falls back to "/", there is also no need
to set a separate sitemap_url_scheme for local builds.

* doc: update sitemaps how-to guide and changelog

Updates sitemaps how-to guide to reflect changes to how html_baseurl is generated and sitemap_url_scheme is set. Updates changelog to reflect removal of duplicate version strings in sitemaps.

Signed-off-by: Minae Lee <minae.lee@canonical.com>
SecondSkoll added a commit that referenced this pull request Dec 10, 2025
* fix: doc slugs and additional initialised Makefile variables (#468)

- Switch doc links to `stable` slug.
- In Makefile, don't init `SOURCEDIR` and `VENVDIR` variables if they already exist at run time. This lets projects override these dirs in parent build scripts.

* ci: make workflows callable by other workflows

* chore: add entries from #468 to changelog

* docs: remove contributing guide template from index (#471)

* fix(build): replace U+2011 chars with hyphens (#472)

* docs: list 'cla-check.yaml' as optional in tutorial (#469)

* fix: sitemap config (#477)

* fix: remove redundancy in sitemap_url_scheme

PR #462 introduced fetching the canonical URL from a RTD environment
variable. In versioned docs, this URL includes the version, which means
that the previous logic to set the sitemap_url_scheme is no longer
necessary and duplicates the version (e.g., "../latest/latest/.."). This
fix removes the duplication.

Since the html_baseurl value falls back to "/", there is also no need
to set a separate sitemap_url_scheme for local builds.

* doc: update sitemaps how-to guide and changelog

Updates sitemaps how-to guide to reflect changes to how html_baseurl is generated and sitemap_url_scheme is set. Updates changelog to reflect removal of duplicate version strings in sitemaps.

Signed-off-by: Minae Lee <minae.lee@canonical.com>

* chore: 1.3.1 release prep

---------

Signed-off-by: Minae Lee <minae.lee@canonical.com>
Co-authored-by: Artem Konev <141050460+akcano@users.noreply.github.com>
Co-authored-by: Arturo Seijas <arturo.seijas@canonical.com>
Co-authored-by: Michael DuBelko <michael.dubelko@canonical.com>
Co-authored-by: JJ Coldiron <jj.coldiron@canonical.com>
Co-authored-by: Minae Lee <minae.lee@canonical.com>
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.

2 participants