diff --git a/conf.py b/conf.py index c1ad471b..73837c1b 100644 --- a/conf.py +++ b/conf.py @@ -23,6 +23,12 @@ author = "Gravwell, Inc." release = "v5.4.3" +# Default to localhost:8000, so the version switcher looks OK on livehtml +version_list_url = os.environ.get( + "VERSION_LIST_URL", "http://localhost:8000/_static/versions.json" +) +print("Using version_list_url:", version_list_url) + # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration @@ -96,7 +102,7 @@ # Version switcher # "switcher": { - "json_url": "https://docs.gravwell.io/_static/versions.json", + "json_url": version_list_url, # The `version` field of each entry in verions.json must match a vN.N.N release name "version_match": release, }, diff --git a/default.nix b/default.nix index 9b527c99..ebc30c39 100644 --- a/default.nix +++ b/default.nix @@ -1,3 +1,4 @@ +{ VERSION_LIST_URL ? null }: let # use a specific (although arbitrarily chosen) version of the Nix package collection pkgs = import (fetchTarball { @@ -66,6 +67,8 @@ in pkgs.stdenv.mkDerivation { name = "gravwell-wiki"; src = ./.; + VERSION_LIST_URL = VERSION_LIST_URL; + buildInputs = [ pythonBundle pkgs.gnumake pkgs.git custom-aspell ]; buildPhase = '' make clean html