From c9e8ce31d26edd1ce8b6a13af260a392e7c7844e Mon Sep 17 00:00:00 2001 From: Ben Darnell Date: Wed, 4 Sep 2024 15:14:30 -0400 Subject: [PATCH] docs: Add readthedocs configuration RTD will no longer do this automagically, so we need to add these lines explicitly for compatibility. See https://about.readthedocs.com/blog/2024/07/addons-by-default/ --- docs/conf.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index bb370587..c2c81b5f 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -146,3 +146,16 @@ def missing_reference_handler(app, env, node, contnode): def setup(app): app.connect("missing-reference", missing_reference_handler) + + +# Read the Docs configuration updates from +# https://about.readthedocs.com/blog/2024/07/addons-by-default/ + +# Define the canonical URL if you are using a custom domain on Read the Docs +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": + if "html_context" not in globals(): + html_context = {} + html_context["READTHEDOCS"] = True -- 2.47.2