From 025897082d6f825254dd81a9b771e7ac299c7b85 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Wed, 25 Sep 2024 12:51:35 -0400 Subject: [PATCH] build: Manually pull some RTD Context. See https://about.readthedocs.com/blog/2024/07/addons-by-default/ for details but essentially RTD is changing how it's building docs and this will let us handle the change gracefully. --- docs/conf.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index f98d27e24d..5889d686a9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -74,3 +74,14 @@ # Set the DJANGO_SETTINGS_MODULE if it's not set. if not os.environ.get('DJANGO_SETTINGS_MODULE'): os.environ['DJANGO_SETTINGS_MODULE'] = 'settings.base' + +# -- Read the Docs Specific Configuration +# 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 +