Skip to content

Commit 94f338c

Browse files
authored
Add html_baseurl to sphinx conf.py (#12364) (#12395)
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 a469e6f commit 94f338c

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
@@ -154,6 +154,7 @@ Jaap Broekhuizen
154154
Jakob van Santen
155155
Jakub Mitoraj
156156
James Bourbeau
157+
James Frost
157158
Jan Balster
158159
Janne Vanhala
159160
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
@@ -272,6 +272,9 @@
272272
# Output file base name for HTML help builder.
273273
htmlhelp_basename = "pytestdoc"
274274

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

276279
# -- Options for LaTeX output --------------------------------------------------
277280

0 commit comments

Comments
 (0)