Skip to content

Commit 3303d22

Browse files
committed
Introduce navigation_startdepth parameter
Allows users to start the sidebar Toc at level 0 Addresses issue pydata#1181
1 parent 39aa0d7 commit 3303d22

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

docs/conf.py

+1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
"navbar_align": "left", # [left, content, right] For testing that the navbar items align properly
146146
"navbar_center": ["version-switcher", "navbar-nav"],
147147
"announcement": "https://raw.githubusercontent.com/pydata/pydata-sphinx-theme/main/docs/_templates/custom-template.html",
148+
"navigation_startdepth": 0,
148149
# "show_nav_level": 2,
149150
# "navbar_start": ["navbar-logo"],
150151
# "navbar_end": ["theme-switcher", "navbar-icon-links"],

src/pydata_sphinx_theme/theme/pydata_sphinx_theme/layout.html

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
{# Create the sidebar links HTML here to re-use in a few places #}
1111
{# If we have no sidebar links, pop the links component from the sidebar list #}
1212
{%- set sidebar_nav_html = generate_toctree_html("sidebar",
13+
startdepth=theme_navigation_startdepth|int,
1314
show_nav_level=theme_show_nav_level|int,
1415
maxdepth=theme_navigation_depth|int,
1516
collapse=theme_collapse_navigation|tobool,

src/pydata_sphinx_theme/theme/pydata_sphinx_theme/theme.conf

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ search_bar_text = Search the docs ...
2525
search_bar_position = sidebar
2626
navigation_with_keys = True
2727
collapse_navigation = False
28+
navigation_startdepth = 1
2829
navigation_depth = 4
2930
show_nav_level = 1
3031
show_toc_level = 1

0 commit comments

Comments
 (0)