Skip to content

Commit

Permalink
ci(sphinx): set READTHEDOCS variable in Jinja2 HTML context (reanahub…
Browse files Browse the repository at this point in the history
  • Loading branch information
jlemesh authored and tiborsimko committed Oct 21, 2024
1 parent ca38c69 commit 46ae9cd
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,16 @@
#
# needs_sphinx = '1.0'

# https://about.readthedocs.com/blog/2024/07/addons-by-default/
# 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

# Do not warn on external images.
suppress_warnings = ["image.nonlocal_uri"]

Expand Down

0 comments on commit 46ae9cd

Please sign in to comment.