Add html_baseurl to sphinx conf.py (#12364) (#12397)

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
This commit is contained in:
James Frost 2024-05-30 12:09:17 +01:00 committed by GitHub
parent da7ca9e732
commit f8fd5ec8dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 0 deletions

View File

@ -114,6 +114,7 @@ Ilya Konstantinov
Ionuț Turturică Ionuț Turturică
Iwan Briquemont Iwan Briquemont
Jaap Broekhuizen Jaap Broekhuizen
James Frost
Jan Balster Jan Balster
Janne Vanhala Janne Vanhala
Jason R. Coombs Jason R. Coombs

1
changelog/12363.doc.rst Normal file
View File

@ -0,0 +1 @@
The documentation webpages now links to a canonical version to reduce outdated documentation in search engine results.

View File

@ -218,6 +218,9 @@ html_show_sourcelink = False
# Output file base name for HTML help builder. # Output file base name for HTML help builder.
htmlhelp_basename = "pytestdoc" htmlhelp_basename = "pytestdoc"
# The base URL which points to the root of the HTML documentation. It is used
# to indicate the location of document using the canonical link relation (#12363).
html_baseurl = "https://docs.pytest.org/en/stable/"
# -- Options for LaTeX output -------------------------------------------------- # -- Options for LaTeX output --------------------------------------------------