Skip to content

Commit

Permalink
Add html_baseurl to sphinx conf.py (#12364) (#12397)
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 da7ca9e commit f8fd5ec
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 @@ -114,6 +114,7 @@ Ilya Konstantinov
Ionuț Turturică
Iwan Briquemont
Jaap Broekhuizen
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 @@ -218,6 +218,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 f8fd5ec

Please sign in to comment.