Skip to content

Commit 826d757

Browse files
authored
Add html_baseurl to sphinx conf.py (#12364) (#12389)
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
1 parent 7df3dbc commit 826d757

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ Jake VanderPlas
188188
Jakob van Santen
189189
Jakub Mitoraj
190190
James Bourbeau
191+
James Frost
191192
Jan Balster
192193
Janne Vanhala
193194
Jason R. Coombs

changelog/12363.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The documentation webpages now links to a canonical version to reduce outdated documentation in search engine results.

doc/en/conf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@
316316
# Output file base name for HTML help builder.
317317
htmlhelp_basename = "pytestdoc"
318318

319+
# The base URL which points to the root of the HTML documentation. It is used
320+
# to indicate the location of document using the canonical link relation (#12363).
321+
html_baseurl = "https://docs.pytest.org/en/stable/"
319322

320323
# -- Options for LaTeX output --------------------------------------------------
321324

0 commit comments

Comments
 (0)