From 9fa1c82c07fe1c2c8f0f2060abfb14418f506365 Mon Sep 17 00:00:00 2001 From: Feanil Patel Date: Wed, 25 Sep 2024 12:50:44 -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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 905d535..c6b23d8 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -513,6 +513,16 @@ def get_version(*file_paths): # # epub_use_index = True +# -- 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 + # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {