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

<link rel="canonical"> in 3.11 docs points at docs.python.org/3/ which is older #1880

Closed
ambv opened this issue Oct 4, 2021 · 5 comments
Closed

Comments

@ambv
Copy link
Contributor

ambv commented Oct 4, 2021

Example:
https://docs.python.org/3.11/whatsnew/3.11.html

In HTML source, you'll find:

<link rel="canonical" href="https://docs.python.org/3/whatsnew/3.11.html" />

This is a bad canonical link (404) since /3/ at the moment points at 3.9 (and very soon will point at 3.10) where there is no "What's New in Python 3.11" page. This is a problem because search engines and social networking link scrapers redirect to canonical links by default.

We should be smarter about this so that newer documentation editions than the default /3/ should simply skip the canonical link altogether. This is the simplest thing we can do that will ensure that:

  • there is no 404 redirect
  • nothing breaks when that version becomes the default and we start redirecting it to /3/
@ned-deily
Copy link
Member

@JulienPalard, ideas?

@JulienPalard
Copy link
Member

docsbuild scripts knows which version is pointed to by /3/ so it knows which version should not have the canonical link.

But I think we should keep canonical links from /anything_newer_than_slash_3/ to /3/ when the page exist to avoid crawlers to see duplicate content.

Maybe docsbuild script can be smart enough to remove canonicals to non-existing pages.

@JulienPalard
Copy link
Member

Fixed in python/docsbuild-scripts@40ce6d1.

@hugovk
Copy link
Member

hugovk commented May 29, 2022

Confirmed that:

<link rel="canonical" href="https://docs.python.org/3/whatsnew/3.10.html" />

Can we close this issue? (I would but triagers don't have close permission for this repo.)

@Mariatta
Copy link
Member

Thanks everyone.

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

No branches or pull requests

5 participants