deprecation of sphinx context injection at build time 43/138743/1 master
authorthmsdt <thomas.kulik@telekom.de>
Wed, 14 Aug 2024 10:14:02 +0000 (12:14 +0200)
committerthmsdt <thomas.kulik@telekom.de>
Wed, 14 Aug 2024 10:16:31 +0000 (12:16 +0200)
Issue-ID: DOC-826

Change-Id: I9f7a5d3066b0f36c498b504e7d7541a4ab4621fa
Signed-off-by: thmsdt <thomas.kulik@telekom.de>
docs/conf.py

index b07fd24..c5dd681 100644 (file)
@@ -2,6 +2,22 @@ project = "onap"
 release = "master"
 version = "master"
 
 release = "master"
 version = "master"
 
+#####
+# Deprecation of Sphinx context injection at build time
+# see https://about.readthedocs.com/blog/2024/07/addons-by-default/
+import os
+
+# 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
+#
+#####
+
 author = "Open Network Automation Platform"
 # yamllint disable-line rule:line-length
 copyright = "ONAP. Licensed under Creative Commons Attribution 4.0 International License"
 author = "Open Network Automation Platform"
 # yamllint disable-line rule:line-length
 copyright = "ONAP. Licensed under Creative Commons Attribution 4.0 International License"