From 1cc12c9394c4a867052b0ecde87fd81ac58bbba1 Mon Sep 17 00:00:00 2001 From: Edan Bainglass Date: Thu, 18 Jul 2024 07:58:02 +0200 Subject: [PATCH] Handle Sphinx context injection deprecation --- docs/conf.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index f34dacd..64ab8c0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,6 @@ import sys from datetime import date -from os import path +from os import path, environ project = "AiiDA" author = "The AiiDA team." @@ -87,6 +87,18 @@ "doc_path": "docs/", } +# handling deprecation of Sphinx context injection at build time +# see https://github.com/pydata/xarray/issues/9251 + +# 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": + html_context["READTHEDOCS"] = True + +# end deprecation handling + html_sidebars = { "index": [], "sections/**": ["sbar-aiida", "sidebar-nav-bs"],