Skip to content

Commit be8dcfc

Browse files
thewtexhjmjohnson
authored andcommitted
STYLE: Specify ReadTheDocs custom domain configuration
Specify the Read The Docs custom domain in the documentation config file. Read the Docs is deprecating Sphinx context injection at build time starting Monday, Oct 7, 2024, so any custom domain specified in the Read the Docs admin needs to be defined in the configuration file. Documentation: https://about.readthedocs.com/blog/2024/07/addons-by-default/
1 parent f6c8b9c commit be8dcfc

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Formatting/conf.py.in

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ sys.path.insert(0, os.path.abspath(os.path.join('@ITKSphinxExamples_BINARY_DIR@'
2929

3030
import pydata_sphinx_theme
3131

32+
# Define the canonical URL if you are using a custom domain on Read the Docs
33+
html_baseurl = os.environ.get("READTHEDOCS_CANONICAL_URL", "examples.itk.org")
34+
35+
html_context = {}
36+
# Tell Jinja2 templates the build is running on Read the Docs
37+
if os.environ.get("READTHEDOCS", "") == "True":
38+
html_context["READTHEDOCS"] = True
39+
3240
# -- General configuration -----------------------------------------------------
3341

3442
# If your documentation needs a minimal Sphinx version, state it here.

0 commit comments

Comments
 (0)