Skip to content

Commit 8c89a7b

Browse files
authored
Add html_baseurl to sphinx conf.py (#12364) (#12393)
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 f530a76 commit 8c89a7b

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
@@ -164,6 +164,7 @@ Jaap Broekhuizen
164164
Jakob van Santen
165165
Jakub Mitoraj
166166
James Bourbeau
167+
James Frost
167168
Jan Balster
168169
Janne Vanhala
169170
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
@@ -273,6 +273,9 @@
273273
# Output file base name for HTML help builder.
274274
htmlhelp_basename = "pytestdoc"
275275

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

277280
# -- Options for LaTeX output --------------------------------------------------
278281

0 commit comments

Comments
 (0)