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

Docs: Experiment with canonical url using READTHEDOCS_CANONICAL_URL #10224

Merged
merged 2 commits into from
Apr 5, 2023

Conversation

benjaoming
Copy link
Contributor

@benjaoming benjaoming commented Apr 5, 2023

This is a quick experiment: I noticed that all the canonical meta tags on all versions of the Jupyter Notebook are almost definitely wrong.. they point to /stable meaning that you cannot generate accurate link previews.

Take for instance this build: https://readthedocs.org/projects/jupyter-notebook/builds/19683327/

The solution is to use our new environment variable 🎉

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@benjaoming benjaoming requested a review from humitos April 5, 2023 09:38
@benjaoming benjaoming marked this pull request as ready for review April 5, 2023 10:04
@benjaoming benjaoming requested a review from a team as a code owner April 5, 2023 10:04
@benjaoming benjaoming requested a review from ericholscher April 5, 2023 10:04
@benjaoming
Copy link
Contributor Author

PR has correct meta tag defined 👍 https://docs--10224.org.readthedocs.build/en/10224/

@benjaoming benjaoming removed the request for review from ericholscher April 5, 2023 10:06
Copy link
Member

@humitos humitos left a comment

Choose a reason for hiding this comment

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

Great!

This is a quick experiment: I noticed that all the canonical meta tags on all versions of the Jupyter Notebook are almost definitely wrong.. they point to /stable meaning that you cannot generate accurate link previews.

Does it make sense to open a PR in their repository with these changes?

@benjaoming
Copy link
Contributor Author

Does it make sense to open a PR in their repository with these changes?

It does 👍 I shared a pointer to this PR, hoping that some Jupyter people would be interested in adding this to their various projects 👍

If we have a couple of successful implementations of this, we can start tracking them in an issue to use READTHEDOCS_CANONICAL_URL for the Sphinx builder conf.py injection - I'm not a big fan of changing the legacy code, but it's misbehaving and perhaps aligning it with the correct/recommended pattern is actually a simplification 👍

ashwinvis added a commit to ashwinvis/notebook that referenced this pull request Apr 5, 2023
As noted in readthedocs/readthedocs.org#10224 with the current configuration the canonical URL is wrong with different sphinx builds. For instance the "latest" docs point to "stable". This leads to apps like Mastodon to generate previews to pages which don't exist since they rely on

    <link rel="canonical" href="https://jupyter-notebook.readthedocs.io/en/stable/notebook_7_features.html" />

This should fix that.
@benjaoming benjaoming merged commit cd86502 into main Apr 5, 2023
@benjaoming benjaoming deleted the use-READTHEDOCS_CANONICAL_URL-conf.py branch April 5, 2023 10:40
jtpio pushed a commit to jupyter/notebook that referenced this pull request Apr 5, 2023
As noted in readthedocs/readthedocs.org#10224 with the current configuration the canonical URL is wrong with different sphinx builds. For instance the "latest" docs point to "stable". This leads to apps like Mastodon to generate previews to pages which don't exist since they rely on

    <link rel="canonical" href="https://jupyter-notebook.readthedocs.io/en/stable/notebook_7_features.html" />

This should fix that.
jtpio added a commit to jupyter/notebook that referenced this pull request Apr 5, 2023
* Use correct canonical URL while building docs (#6829)

As noted in readthedocs/readthedocs.org#10224 with the current configuration the canonical URL is wrong with different sphinx builds. For instance the "latest" docs point to "stable". This leads to apps like Mastodon to generate previews to pages which don't exist since they rely on

    <link rel="canonical" href="https://jupyter-notebook.readthedocs.io/en/stable/notebook_7_features.html" />

This should fix that.

* Renaming migration file to `migrating_to_notebook7`

* Use the correct name

* fix ref

---------

Co-authored-by: Ashwin V. Mohanan <9155111+ashwinvis@users.noreply.github.com>
illia-v added a commit to illia-v/urllib3 that referenced this pull request Jun 8, 2023
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.

2 participants