Read the Docs was always mangling the conf.py during the build to
inject custom domains configured in the project settings and some
other stuff.  But they will stop doing that soon [1].

Adding recommended changes to the config to get this info from the
environment.

[1] https://about.readthedocs.com/blog/2024/07/addons-by-default/

Signed-off-by: Ilya Maximets <[email protected]>
---
 Documentation/conf.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/Documentation/conf.py b/Documentation/conf.py
index 15785605a..2364405ad 100644
--- a/Documentation/conf.py
+++ b/Documentation/conf.py
@@ -12,6 +12,7 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
+import os
 import string
 import sys
 
@@ -108,6 +109,13 @@ html_logo = '_static/logo.png'
 # so a file named "default.css" will overwrite the builtin "default.css".
 html_static_path = ['_static']
 
+# Define the canonical URL for our domain configured on Read the Docs.
+html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
+
+# Tell Jinja2 templates the build is running on Read the Docs.
+html_context = {}
+if os.environ.get("READTHEDOCS", "") == "True":
+    html_context["READTHEDOCS"] = True
 
 # -- Options for manual page output ---------------------------------------
 
-- 
2.45.2

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to