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

Add html_baseurl to sphinx conf.py #12364

Merged
merged 4 commits into from
May 26, 2024
Merged

Add html_baseurl to sphinx conf.py #12364

merged 4 commits into from
May 26, 2024

Conversation

jfrost-mo
Copy link
Contributor

This is used to set the tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up.

Fixes #12363

It would be worth checking the ReadTheDocs admin settings first, which I don't have access to. But if the domain is already set correctly as the canonical one, then this PR should manually add in the required HTML tag.

This change will also have to be backported to old versions of the documentation to have the desired effect on search engine indexes.

jfrost-mo added 3 commits May 24, 2024 15:55
This is used to set the <link rel="canonical" href="X"> tag that
points to the canonical version of the webpage. Including this
indicates to search engines which version to include in their
indexes, and should prevent older versions showing up.

Fixes #12363
@nicoddemus
Copy link
Member

Thanks @jfrost-mo!

Here is the current configuration:

It would be worth checking the ReadTheDocs admin settings first, which I don't have access to. But if the domain is already set correctly as the canonical one, then this PR should manually add in the required HTML tag.

image

Is this correct?

@jfrost-mo
Copy link
Contributor Author

jfrost-mo commented May 24, 2024

In that case it looks like its not working for whatever reason. This PR is probably the way to go then, and it seems to work well enough.

Current docs:
View source of currently published docs, showing no link rel canonical tag

With this PR:
View source of docs from this PR, showing a link rel canonical tag

@jfrost-mo jfrost-mo marked this pull request as ready for review May 24, 2024 15:17
@nicoddemus
Copy link
Member

Great, thanks for confirming.

In any case, I personally prefer for that configuration to be in pytest's repository anyway, rather than "tucked away" in ReadTheDocs config.

Thanks again!

doc/en/conf.py Outdated Show resolved Hide resolved
@jfrost-mo
Copy link
Contributor Author

Once this is in it will need backporting to any branch that currently has published documentation to have its effect. Then you'll need to wait for the search engines to update their indexes, though this can be encouraged along by using the various search consoles to request a reindex: Google | Bing

@nicoddemus nicoddemus merged commit 020db7e into pytest-dev:main May 26, 2024
27 checks passed
nicoddemus pushed a commit that referenced this pull request May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up.

Fixes #12363
nicoddemus pushed a commit that referenced this pull request May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up.

Fixes #12363
nicoddemus pushed a commit that referenced this pull request May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up.

Fixes #12363
nicoddemus pushed a commit that referenced this pull request May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up.

Fixes #12363
nicoddemus pushed a commit that referenced this pull request May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up.

Fixes #12363
nicoddemus pushed a commit that referenced this pull request May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up.

Fixes #12363
nicoddemus pushed a commit that referenced this pull request May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up.

Fixes #12363
nicoddemus pushed a commit that referenced this pull request May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up.

Fixes #12363
nicoddemus pushed a commit that referenced this pull request May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up.

Fixes #12363
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.

Link canonical documentation to discourage search engines from linking old docs
2 participants