summaryrefslogtreecommitdiff
path: root/doc/source/conf.py
diff options
context:
space:
mode:
authorPamphile Roy <roy.pamphile@gmail.com>2022-05-22 18:37:10 +0200
committerGitHub <noreply@github.com>2022-05-22 09:37:10 -0700
commit89b4f725b0babe3ddacb60df972118c9bc6e0e4a (patch)
tree5094b397ecda8b76b731420a6fdb302da6ca8a15 /doc/source/conf.py
parent7f5d234ef617c4c34376c003879bd64bce5ccdfb (diff)
downloadnumpy-89b4f725b0babe3ddacb60df972118c9bc6e0e4a.tar.gz
DOC: Style version switcher button (#21451)
* DOC: use PR ref as version name in CircleCI preview * DOC: style version button depending on release * DOC: fix logic for switcher_version. [skip actions] [skip azp] [skip travis] * DOC: provision empty dataset attribute and simplify not. [skip actions] [skip azp] [skip travis]
Diffstat (limited to 'doc/source/conf.py')
-rw-r--r--doc/source/conf.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/source/conf.py b/doc/source/conf.py
index 5c056b201..854885270 100644
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -172,7 +172,11 @@ html_logo = '_static/numpylogo.svg'
html_favicon = '_static/favicon/favicon.ico'
# Set up the version switcher. The versions.json is stored in the devdocs.
-if ".dev" in version:
+if os.environ.get('CIRCLE_JOB', False) and \
+ os.environ.get('CIRCLE_BRANCH', '') != 'main':
+ # For PR, name is set to its ref
+ switcher_version = os.environ['CIRCLE_BRANCH']
+elif ".dev" in version:
switcher_version = "devdocs"
else:
switcher_version = f"doc/{version}"