From 28e05560160fd940b83e7e23788ad5165def56e0 Mon Sep 17 00:00:00 2001 From: Matt Marshall Date: Wed, 17 Jul 2024 09:47:42 +0100 Subject: [PATCH] Docs: config.py changes to use readthedocs addons Instigated by https://about.readthedocs.com/blog/2024/07/addons-by-default/ Modified docs/conf.py to add lines suggested by the above blog post, in preparation of the changes at read the docs. We also should opt-in to the addon to ensure that this works ahead of the deprecation in October --- documentation/conf.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/documentation/conf.py b/documentation/conf.py index 0801bee2..b13c0c70 100644 --- a/documentation/conf.py +++ b/documentation/conf.py @@ -124,6 +124,17 @@ # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = False +## -- Read The Docs addons enabled by default +## -- this block is designed to keep the behaviour of the pre 2024-10 builds by defining html_baseurl inside this file, as read the docs are no longer injecting it. +## -- See https://about.readthedocs.com/blog/2024/07/addons-by-default/ for more details + +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") + +# We also need to tell the Jinja2 templates that the build is running on Read The Docs +if os.environ.get("READTHEDOCS", "") == "True": + html_context["READTHEDOCS"] = True + + # -- Options for HTML output ----------------------------------------------