-
-
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
Build: export READTHEDOCS_CANONICAL_URL variable #10166
Conversation
This variable communicates what's the canonical URL for the version it's running the build. It will allow doctool/theme authors to implement the correct HTML tag required: ``` <link rel="canonical" href="" /> ``` Note the final `href` on each page will be `READTHEDOCS_CANONICAL_URL` + `page`. Closes readthedocs/readthedocs-ops#1320
Add it to the reference page.
This is a great idea. The current situation is that links for PR builds break link previews. Should we start using it for the Sphinx builder config so people who might see the injected configuration will understand the new pattern? https://github.com/readthedocs/readthedocs.org/blob/main/readthedocs/doc_builder/templates/doc_builder/conf.py.tmpl#L155 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work 🎉
If you are updating the tests, I think you should use strict values rather than <ANY>
so we can detect changes to the canonical URL in a very strict sense.
From our conversation on Slack, I understood that we are going to slowly deprecate this feature and rely on doctool/theme authors to implement it correctly by using this new environment variable. In general, we are moving away from the idea of "do magical things on behalf of our users" |
Co-authored-by: Benjamin Balder Bach <[email protected]>
Co-authored-by: Benjamin Balder Bach <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Thanks for addressing the feedback 🥇
This variable communicates what's the canonical URL for the version it's running
the build. It will allow doctool/theme authors to implement the correct HTML tag
required:
Note the final
href
on each page will beREADTHEDOCS_CANONICAL_URL
+page
.Closes readthedocs/readthedocs-ops#1320
Closes #9781
Closes #8260
Closes #4820
📚 Documentation previews 📚
docs
): https://docs--10166.org.readthedocs.build/en/10166/dev
): https://dev--10166.org.readthedocs.build/en/10166/