Skip to content

Commit f8fd5ec

Browse files
authored
Add html_baseurl to sphinx conf.py (#12364) (#12397)
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 da7ca9e commit f8fd5ec

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
@@ -114,6 +114,7 @@ Ilya Konstantinov
114114
Ionuț Turturică
115115
Iwan Briquemont
116116
Jaap Broekhuizen
117+
James Frost
117118
Jan Balster
118119
Janne Vanhala
119120
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
@@ -218,6 +218,9 @@
218218
# Output file base name for HTML help builder.
219219
htmlhelp_basename = "pytestdoc"
220220

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

222225
# -- Options for LaTeX output --------------------------------------------------
223226

0 commit comments

Comments
 (0)