Skip to content

Commit

Permalink
fix: remove primary sidebar if empty (#980)
Browse files Browse the repository at this point in the history
* fix: remove primary sidebar if empty

* refactor: use eq 0 instead of < 1
  • Loading branch information
12rambau committed Oct 5, 2022
1 parent 284e091 commit 6489f3b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pydata_sphinx_theme/theme/pydata_sphinx_theme/layout.html
Expand Up @@ -12,12 +12,12 @@
includehidden=True,
titles_only=True)
-%}
{% if not sidebar_nav_html %}
{% if sidebar_nav_html | length == 0 %}
{% set sidebars = sidebars | reject("in", "sidebar-nav-bs.html") | list %}
{% endif %}

{# Remove the page-toc from secondary sidebar if there are no links to show #}
{% if generate_toc_html() | length < 1 %}
{% if generate_toc_html() | length == 0 %}
{% set theme_page_sidebar_items = theme_page_sidebar_items | reject("in", "page-toc.html") | list %}
{% endif %}

Expand Down

0 comments on commit 6489f3b

Please sign in to comment.