Skip to content

The agent engineering platform.

docs: readthedocs deprecation fix (#24321)

Erick Friisdd7938ace8f5
diff --git a/docs/api_reference/conf.py b/docs/api_reference/conf.py
index 3e49b5fc00..6e4ed759f3 100644
--- a/docs/api_reference/conf.py
+++ b/docs/api_reference/conf.py
@@ -178,3 +178,10 @@ autosummary_generate = True
html_copy_source = False
html_show_sourcelink = False
+
+# Set canonical URL from the Read the Docs Domain
+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":
+ html_context["READTHEDOCS"] = True