Skip to content

Commit cb1360a

Browse files
Update conf.py, sphinx context injection deprecated in ReadTheDocs (#383)
* Update conf.py, sphinx context injection deprecated in ReadTheDocs ReadTheDocs is deprecating sphinx context injection. See details at #382 * Update docs/conf.py, define html_context variable Co-authored-by: jakirkham <[email protected]> * Handle already defined `html_context` --------- Co-authored-by: jakirkham <[email protected]>
1 parent 77a29ba commit cb1360a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/conf.py

+9
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,15 @@
120120

121121
# -- Options for HTML output -------------------------------------------
122122

123+
# Set canonical URL from the Read the Docs Domain
124+
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "")
125+
126+
# Tell Jinja2 templates the build is running on Read the Docs
127+
if os.environ.get("READTHEDOCS", "") == "True":
128+
if "html_context" not in globals():
129+
html_context = {}
130+
html_context["READTHEDOCS"] = True
131+
123132
# The theme to use for HTML and HTML Help pages. See the documentation for
124133
# a list of builtin themes.
125134
html_theme = 'dask_sphinx_theme'

0 commit comments

Comments
 (0)