From 5c6c1ae2d7b4e5225bc52bfa184da04481797cec Mon Sep 17 00:00:00 2001 From: Paul-Emmanuel Raoul Date: Sat, 26 Oct 2024 08:59:04 +0200 Subject: [PATCH] Fix support for Read the Docs addons 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 db63ed6..3120d28 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -6,6 +6,7 @@ # pylint: skip-file from datetime import datetime +from os import environ from probequest import __version__ as VERSION @@ -62,3 +63,15 @@ # http://blockdiag.com/en/seqdiag/sphinxcontrib.html seqdiag_fontpath = "/usr/share/fonts/truetype/ipafont/ipagp.ttf" + +# -- Read the Docs ----------------------------------------------------------- + +# Set canonical URL from the Read the Docs Domain +html_baseurl = environ.get("READTHEDOCS_CANONICAL_URL", "") + +# Tell Jinja2 templates the build is running on Read the Docs +if environ.get("READTHEDOCS", "") == "True": + if "html_context" not in globals(): + html_context = {} + + html_context["READTHEDOCS"] = True