Skip to content

fix: sitemap config#477

Merged
minaelee merged 2 commits intocanonical:devfrom
minaelee:sitemap-config
Dec 10, 2025
Merged

fix: sitemap config#477
minaelee merged 2 commits intocanonical:devfrom
minaelee:sitemap-config

Conversation

@minaelee
Copy link
Copy Markdown
Collaborator

@minaelee minaelee commented Dec 4, 2025

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

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, as in these examples:

image

image

This fix removes the duplication and should work for both versioned and non-versioned docs. Since the html_baseurl value falls back to "/", there is also no need to set a separate sitemap_url_scheme for local builds.

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 changed the base branch from main to dev December 4, 2025 18:48
@minaelee minaelee marked this pull request as ready for review December 4, 2025 20:30
Copy link
Copy Markdown
Collaborator

@medubelko medubelko left a comment

Choose a reason for hiding this comment

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

Code LGTM.

Comment thread docs/how-to/set-up-sitemaps.rst Outdated
Comment thread docs/how-to/set-up-sitemaps.rst
Comment thread docs/how-to/set-up-sitemaps.rst Outdated
Comment thread docs/conf.py
@minaelee minaelee force-pushed the sitemap-config branch 3 times, most recently from a89a667 to 66bd693 Compare December 8, 2025 06:32
This updates the sitemaps how-to guide to reflect changes to how the
html_baseurl is generated and how sitemap_url_scheme is set. It also
updates the changelog to reflect removal of the duplicate version
strings in sitemaps.

Signed-off-by: Minae Lee <minae.lee@canonical.com>
Copy link
Copy Markdown
Collaborator

@medubelko medubelko left a comment

Choose a reason for hiding this comment

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

Thanks!

@minaelee minaelee merged commit 820880f into canonical:dev Dec 10, 2025
5 checks passed
@SecondSkoll SecondSkoll mentioned this pull request Dec 10, 2025
2 tasks
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.

3 participants