mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed rendering of section index pages with no other pages
This commit is contained in:
parent
e2292808cc
commit
149b0dbc47
@ -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 }}">
|
||||
|
@ -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 %}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user