Allow setting a canonical URL via ogp_canonical_url#134
Merged
AA-Turner merged 1 commit intosphinx-doc:mainfrom Apr 3, 2025
Merged
Allow setting a canonical URL via ogp_canonical_url#134AA-Turner merged 1 commit intosphinx-doc:mainfrom
ogp_canonical_url#134AA-Turner merged 1 commit intosphinx-doc:mainfrom
Conversation
9d48604 to
def0796
Compare
This was referenced Apr 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR builds on #133, only the final commit is new.
We introduce a new setting,
ogp_canonical_url, which defines the canonical or permanent URL for a webpage, similarly torel="canonical". The motivating example is Python's documentation, where we have multiple different sites (e.g. 3.12, 3.13, 3.14), but we want search engines and other tools to usedocs.python.org/3/as the canonical URL.I had considered solving this problem another way, by allowing the URL only for images to be changed, but I believe that this solution is conceptually better, and maps more closely to the description of
og:urlin the Open Graph Protocol specification.Please let me know your thoughts and feedback!
A