Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix dirhtml canonical url #53

Merged
merged 1 commit into from
Nov 10, 2021
Merged

fix dirhtml canonical url #53

merged 1 commit into from
Nov 10, 2021

Conversation

davidism
Copy link
Member

@davidism davidism commented Nov 10, 2021

Sphinx 1.8 added support for outputting canonical URLs based on the html_baseurl config. However, the dirhtml builder doesn't override the value, so it uses the standard html url that ends with .html. See sphinx-doc/sphinx#9730.

Since Sphinx supports generating canonical URLs deprecate our canonical_url config and remove the related template code.

Detect if the dirhtml builder is used and is generating invalid URLs, and use our existing logic to generate the correct URL. The workaround will be skipped if it looks like Sphinx has fixed the bug.

closes #47

deprecate canonical_url config in favor of built-in html_baseurl
@davidism davidism merged commit 33a47de into main Nov 10, 2021
@davidism davidism deleted the fix-canonical branch November 10, 2021 16:06
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect canonical links on project website
1 participant