Fixed filtering of subsequent index.md files when using section index pages

This commit is contained in:
squidfunk 2021-12-19 11:12:30 +01:00
parent a32760bdee
commit f3926bf444
2 changed files with 8 additions and 11 deletions

View File

@ -21,9 +21,9 @@
{% endif %}
{% set indexes = [] %}
{% if "navigation.indexes" in features %}
{% for item in nav_item.children %}
{% if item.is_index and not index is defined %}
{% set _ = indexes.append(item) %}
{% for nav_item in nav_item.children %}
{% if nav_item.is_index and not index is defined %}
{% set _ = indexes.append(nav_item) %}
{% endif %}
{% endfor %}
{% endif %}
@ -51,8 +51,7 @@
</label>
<ul class="md-nav__list" data-md-scrollfix>
{% for nav_item in nav_item.children %}
{% if "navigation.indexes" in features and nav_item.is_index %}
{% else %}
{% if not indexes or nav_item != indexes | first %}
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
{% endif %}
{% endfor %}

View File

@ -66,9 +66,9 @@
<!-- Determine all nested items that are index pages -->
{% set indexes = [] %}
{% if "navigation.indexes" in features %}
{% for item in nav_item.children %}
{% if item.is_index and not index is defined %}
{% set _ = indexes.append(item) %}
{% for nav_item in nav_item.children %}
{% if nav_item.is_index and not index is defined %}
{% set _ = indexes.append(nav_item) %}
{% endif %}
{% endfor %}
{% endif %}
@ -110,9 +110,7 @@
<!-- Render nested item list -->
{% for nav_item in nav_item.children %}
{% if "navigation.indexes" in features and nav_item.is_index %}
<!-- Render nothing -->
{% else %}
{% if not indexes or nav_item != indexes | first %}
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
{% endif %}
{% endfor %}