Skip to content

Commit

Permalink
Fix json_url, kind of... see pydata/pydata-sphinx-theme#1389
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnoe authored and Tobychev committed Apr 10, 2024
1 parent 5116a14 commit 08dfdc9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,19 +210,19 @@ def setup(app):
json_url = "https://ctapipe.readthedocs.io/en/latest/_static/switcher.json"

# Define the version we use for matching in the version switcher.
version_match = os.environ.get("READTHEDOCS_VERSION")
version_match = os.getenv("READTHEDOCS_VERSION")
# If READTHEDOCS_VERSION doesn't exist, we're not on RTD
# If it is an integer, we're in a PR build and the version isn't correct.
if not version_match or version_match.isdigit():
# For local development, infer the version to match from the package.
if "dev" in release or "rc" in release:
version_match = "latest"
# We want to keep the relative reference if we are in dev mode
# but we want the whole url if we are effectively in a released version
json_url = "/_static/switcher.json"
else:
version_match = release

# We want to keep the relative reference when on a pull request or locally
json_url = "_static/switcher.json"


# -- Options for HTML output ----------------------------------------------

Expand Down

0 comments on commit 08dfdc9

Please sign in to comment.