Skip to content

Commit 020db7e

Browse files
authored
Add html_baseurl to sphinx conf.py (#12364)
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 f8dfc1d commit 020db7e

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ Jake VanderPlas
192192
Jakob van Santen
193193
Jakub Mitoraj
194194
James Bourbeau
195+
James Frost
195196
Jan Balster
196197
Janne Vanhala
197198
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
@@ -312,6 +312,9 @@
312312
# Output file base name for HTML help builder.
313313
htmlhelp_basename = "pytestdoc"
314314

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

316319
# -- Options for LaTeX output --------------------------------------------------
317320

0 commit comments

Comments
 (0)