From dd7938ace8f519e78cfcf00af98d8f7e167ae2cc Mon Sep 17 00:00:00 2001 From: Erick Friis Date: Tue, 16 Jul 2024 13:32:51 -0700 Subject: [PATCH] docs: readthedocs deprecation fix (#24321) https://about.readthedocs.com/blog/2024/07/addons-by-default/#how-does-it-affect-my-projects we use build.command so we're already using addons, so I think this is it --- docs/api_reference/conf.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/api_reference/conf.py b/docs/api_reference/conf.py index 3e49b5fc00c..6e4ed759f3c 100644 --- a/docs/api_reference/conf.py +++ b/docs/api_reference/conf.py @@ -178,3 +178,10 @@ autosummary_generate = True html_copy_source = False html_show_sourcelink = False + +# Set canonical URL from the Read the Docs Domain +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") + +# Tell Jinja2 templates the build is running on Read the Docs +if os.environ.get("READTHEDOCS", "") == "True": + html_context["READTHEDOCS"] = True