Skip to content

Conditionally add toggle sidebar button#925

Open
max-marped wants to merge 1 commit intoexecutablebooks:masterfrom
max-marped:924-hide-sidebar-button-on-empty-sidebar
Open

Conditionally add toggle sidebar button#925
max-marped wants to merge 1 commit intoexecutablebooks:masterfrom
max-marped:924-hide-sidebar-button-on-empty-sidebar

Conversation

@max-marped
Copy link

@max-marped max-marped commented Feb 18, 2026

This fixes the issue where the sidebar-toggle primary-toggle button is shown even though there is no sidebar to show. If you for example configure a page to not have a sidebar using the html_sidebars setting as described in the docs.

The condition matches how pydata-sphinx-theme does it for rendering the sidebar elements in sidebar-primary.html.

Cheers!

Solves: #924

@max-marped max-marped changed the title Conditionally adding toggle sidebar button if there are sidebars to show Conditionally add toggle sidebar button Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant