Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 4c030e9

Browse files
committed
Disable version switcher on circleci
1 parent 76978e3 commit 4c030e9

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

doc/conf.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,19 @@ def js_tag_with_cache_busting(js):
479479
# and CI builds https://github.com/pydata/pydata-sphinx-theme/pull/386
480480
"collapse_navigation": not is_release_build,
481481
"show_prev_next": False,
482-
"switcher": {
482+
"navbar_end": ["theme-switcher", "version-switcher", "mpl_icon_links"],
483+
"navbar_persistent": ["search-button"],
484+
"footer_start": ["copyright", "sphinx-version", "doc_version"],
485+
# We override the announcement template from pydata-sphinx-theme, where
486+
# this special value indicates the use of the unreleased banner. If we need
487+
# an actual announcement, then just place the text here as usual.
488+
"announcement": "unreleased" if not is_release_build else "",
489+
}
490+
if not CIRCLECI:
491+
# CircleCI hosted docs cannot load
492+
# https://matplotlib.org/devdocs/_static/switcher.json,
493+
# so only enable the version switcher if not on CircleCI
494+
html_theme_options["switcher"] = {
483495
# Add a unique query to the switcher.json url. This will be ignored by
484496
# the server, but will be used as part of the key for caching by browsers
485497
# so when we do a new meso release the switcher will update "promptly" on
@@ -490,15 +502,7 @@ def js_tag_with_cache_busting(js):
490502
# We either go to 'stable' or to 'devdocs'
491503
'stable' if matplotlib.__version_info__.releaselevel == 'final'
492504
else 'devdocs')
493-
},
494-
"navbar_end": ["theme-switcher", "version-switcher", "mpl_icon_links"],
495-
"navbar_persistent": ["search-button"],
496-
"footer_start": ["copyright", "sphinx-version", "doc_version"],
497-
# We override the announcement template from pydata-sphinx-theme, where
498-
# this special value indicates the use of the unreleased banner. If we need
499-
# an actual announcement, then just place the text here as usual.
500-
"announcement": "unreleased" if not is_release_build else "",
501-
}
505+
}
502506
include_analytics = is_release_build
503507
if include_analytics:
504508
html_theme_options["analytics"] = {

0 commit comments

Comments
 (0)