From 08dfdc9c894a8c646b4388024690e9ac7730966a Mon Sep 17 00:00:00 2001 From: Maximilian Linhoff Date: Fri, 21 Jul 2023 17:28:18 +0200 Subject: [PATCH] Fix json_url, kind of... see https://github.com/pydata/pydata-sphinx-theme/issues/1389 --- docs/conf.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 6a4a5ee4859..013d575931e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -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 ----------------------------------------------