Skip to content

Commit

Permalink
Fixed rendering of section index pages with no other pages
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Oct 2, 2021
1 parent e229280 commit 149b0db
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
8 changes: 5 additions & 3 deletions material/partials/nav-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,11 @@
{% set class = "md-nav__link--active" if index == page %}
<div class="md-nav__link md-nav__link--index {{ class }}">
<a href="{{ index.url | url }}">{{ nav_item.title }}</a>
<label for="{{ path }}">
<span class="md-nav__icon md-icon"></span>
</label>
{% if nav_item.children | length > 1 %}
<label for="{{ path }}">
<span class="md-nav__icon md-icon"></span>
</label>
{% endif %}
</div>
{% endif %}
<nav class="md-nav" aria-label="{{ nav_item.title }}" data-md-level="{{ level }}">
Expand Down
10 changes: 7 additions & 3 deletions src/partials/nav-item.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,13 @@
{% set class = "md-nav__link--active" if index == page %}
<div class="md-nav__link md-nav__link--index {{ class }}">
<a href="{{ index.url | url }}">{{ nav_item.title }}</a>
<label for="{{ path }}">
<span class="md-nav__icon md-icon"></span>
</label>

<!-- Only render toggle if there's at least one more page -->
{% if nav_item.children | length > 1 %}
<label for="{{ path }}">
<span class="md-nav__icon md-icon"></span>
</label>
{% endif %}
</div>
{% endif %}

Expand Down

0 comments on commit 149b0db

Please sign in to comment.