-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Sphinx builder: Use READTHEDOCS_CANONICAL_URL as html_baseurl
#10226
Comments
I saw this use case which looks at the I wonder if overriding this might be an issue? |
Interesting! It looks safe from RTD injection since it's already guarded by a conditional: https://github.com/pydata/pydata-sphinx-theme/blob/d98350b581b5dd804b918b1f6c82a51964957df8/docs/conf.py#L59 If It's a bit hard to say what a project could need for development settings. Some might view local files with |
We are moving away from the idea of adding/changing "magic" on our build process. Eventually, we should remove it all and only document how to use our environment variables properly on different doctools as #10246 mention. I'm closing this issue for now but we can re-open if we want to. |
Proof of concept:
If this turns out to work well, I think we should escalate the pattern to replace the current implementation:
readthedocs.org/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl
Lines 151 to 156 in f02bc09
tldr; Why is it broken? What changed?
It can look odd that we have a behavior on Read the Docs Sphinx builder that looks broken and keeps coming up as an issue... I think it's an honest well-meaning implementation that's currently there. The outside understanding of what "canonical" means has just slowly pushed towards a new understanding.
The current implementation of "canonical URL", results in a meta tag
canonical
that simply points to the default version of a documentation, i.e./en/stable
.It's possible to have the understanding that a "canonical URL" should always point to the default version. And that might have been the honest cause for the current implementation. But that's unfortunately an understanding of websites that doesn't match current-day usage of the
canonical
meta tag.More and more chat clients and social media are reading the "canonical URL" in order to get a cleaned up version for a link, something resembling a "permalink". We started seeing the issue more and more since Mastodon uses the
canonical
meta field when parsing link data for preview cards.So this ultimately means that preview cards and other auto-generated versions will not point to the same version as the link that got shared. And that's just wrong from a user's POV.
The text was updated successfully, but these errors were encountered: