From 826d7576c250c5493ddce3b56c58dacf99ed344e Mon Sep 17 00:00:00 2001 From: James Frost Date: Thu, 30 May 2024 12:08:51 +0100 Subject: [PATCH] Add html_baseurl to sphinx conf.py (#12364) (#12389) This is used to set the 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 --- AUTHORS | 1 + changelog/12363.doc.rst | 1 + doc/en/conf.py | 3 +++ 3 files changed, 5 insertions(+) create mode 100644 changelog/12363.doc.rst diff --git a/AUTHORS b/AUTHORS index 92d3a14c7..6027b6ee5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -188,6 +188,7 @@ Jake VanderPlas Jakob van Santen Jakub Mitoraj James Bourbeau +James Frost Jan Balster Janne Vanhala Jason R. Coombs diff --git a/changelog/12363.doc.rst b/changelog/12363.doc.rst new file mode 100644 index 000000000..c657281ba --- /dev/null +++ b/changelog/12363.doc.rst @@ -0,0 +1 @@ +The documentation webpages now links to a canonical version to reduce outdated documentation in search engine results. diff --git a/doc/en/conf.py b/doc/en/conf.py index 32ecaa174..8b75a8706 100644 --- a/doc/en/conf.py +++ b/doc/en/conf.py @@ -316,6 +316,9 @@ html_show_sourcelink = False # 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 --------------------------------------------------