Skip to content

Commit

Permalink
Set html_baseurl and html_context from environment variables
Browse files Browse the repository at this point in the history
  • Loading branch information
RKrahl committed Oct 2, 2024
1 parent 70d153b commit 67bf6fe
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config

import os
from pathlib import Path
import sys

Expand Down Expand Up @@ -90,6 +91,15 @@
#
# html_theme_options = {}

# 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

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
Expand Down

0 comments on commit 67bf6fe

Please sign in to comment.