Skip to content

Commit 029b2b6

Browse files
authored
Add html_baseurl to sphinx conf.py (#12364) (#12390)
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 e53f798 commit 029b2b6

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
@@ -184,6 +184,7 @@ Jake VanderPlas
184184
Jakob van Santen
185185
Jakub Mitoraj
186186
James Bourbeau
187+
James Frost
187188
Jan Balster
188189
Janne Vanhala
189190
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)