From 90c9f76447cee74808341c6eb7ae9a882c405154 Mon Sep 17 00:00:00 2001 From: edtechre Date: Wed, 17 Jul 2024 14:28:04 -0700 Subject: [PATCH] Set RTD canonical URL --- docs/source/conf.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/source/conf.py b/docs/source/conf.py index ebb23db..4bdbba3 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -53,6 +53,12 @@ html_theme = "sphinx_rtd_theme" html_static_path = ["../_static"] html_extra_path = ["../_html"] +# Set canonical URL from the Read the Docs Domain +html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "") +html_context = {} +# Tell Jinja2 templates the build is running on Read the Docs +if os.environ.get("READTHEDOCS", "") == "True": + html_context["READTHEDOCS"] = True # Multi-language docs. language = "en"