Skip to content

Commit

Permalink
Add workaround for theme versions that don't support mode switcher.
Browse files Browse the repository at this point in the history
  • Loading branch information
rossbar committed Jul 6, 2022
1 parent a194b5b commit 26caf95
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion doc/conf.py
Expand Up @@ -83,8 +83,17 @@
html_theme_options = {
"github_url": "https://github.com/numpy/numpydoc",
"show_prev_next": False,
"navbar_end": ["theme-switcher", "search-field.html", "navbar-icon-links.html"],
"navbar_end": ["search-field.html", "navbar-icon-links.html"],
}
# Add version switcher for versions of pydata_sphinx_theme that support it
import packaging
import pydata_sphinx_theme

if packaging.version.parse(pydata_sphinx_theme.__version__) >= packaging.version.parse(
"0.9.0"
):
html_theme_options["navbar_end"].insert(0, "theme-switcher")

html_sidebars = {
"**": [],
}
Expand Down

0 comments on commit 26caf95

Please sign in to comment.