Skip to content

Commit

Permalink
Add html_baseurl to sphinx conf.py (#12364) (#12396)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jfrost-mo committed May 30, 2024
1 parent 20f1c95 commit aa6f97d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Iwan Briquemont
Jaap Broekhuizen
Jakob van Santen
Jakub Mitoraj
James Frost
Jan Balster
Janne Vanhala
Jason R. Coombs
Expand Down
1 change: 1 addition & 0 deletions changelog/12363.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The documentation webpages now links to a canonical version to reduce outdated documentation in search engine results.
3 changes: 3 additions & 0 deletions doc/en/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@
# Output file base name for HTML help builder.
htmlhelp_basename = "pytestdoc"

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

# -- Options for LaTeX output --------------------------------------------------

Expand Down

0 comments on commit aa6f97d

Please sign in to comment.