Skip to content

Commit aa6f97d

Browse files
authored
Add html_baseurl to sphinx conf.py (#12364) (#12396)
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 20f1c95 commit aa6f97d

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ Iwan Briquemont
137137
Jaap Broekhuizen
138138
Jakob van Santen
139139
Jakub Mitoraj
140+
James Frost
140141
Jan Balster
141142
Janne Vanhala
142143
Jason R. Coombs

changelog/12363.doc.rst

+1
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

+3
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@
235235
# Output file base name for HTML help builder.
236236
htmlhelp_basename = "pytestdoc"
237237

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

239242
# -- Options for LaTeX output --------------------------------------------------
240243

0 commit comments

Comments
 (0)