mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-06-14 11:52:32 +03:00
Fixed filtering of subsequent index.md files when using section index pages
This commit is contained in:
parent
a32760bdee
commit
f3926bf444
@ -21,9 +21,9 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% set indexes = [] %}
|
{% set indexes = [] %}
|
||||||
{% if "navigation.indexes" in features %}
|
{% if "navigation.indexes" in features %}
|
||||||
{% for item in nav_item.children %}
|
{% for nav_item in nav_item.children %}
|
||||||
{% if item.is_index and not index is defined %}
|
{% if nav_item.is_index and not index is defined %}
|
||||||
{% set _ = indexes.append(item) %}
|
{% set _ = indexes.append(nav_item) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -51,8 +51,7 @@
|
|||||||
</label>
|
</label>
|
||||||
<ul class="md-nav__list" data-md-scrollfix>
|
<ul class="md-nav__list" data-md-scrollfix>
|
||||||
{% for nav_item in nav_item.children %}
|
{% for nav_item in nav_item.children %}
|
||||||
{% if "navigation.indexes" in features and nav_item.is_index %}
|
{% if not indexes or nav_item != indexes | first %}
|
||||||
{% else %}
|
|
||||||
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
|
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -66,9 +66,9 @@
|
|||||||
<!-- Determine all nested items that are index pages -->
|
<!-- Determine all nested items that are index pages -->
|
||||||
{% set indexes = [] %}
|
{% set indexes = [] %}
|
||||||
{% if "navigation.indexes" in features %}
|
{% if "navigation.indexes" in features %}
|
||||||
{% for item in nav_item.children %}
|
{% for nav_item in nav_item.children %}
|
||||||
{% if item.is_index and not index is defined %}
|
{% if nav_item.is_index and not index is defined %}
|
||||||
{% set _ = indexes.append(item) %}
|
{% set _ = indexes.append(nav_item) %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@ -110,9 +110,7 @@
|
|||||||
|
|
||||||
<!-- Render nested item list -->
|
<!-- Render nested item list -->
|
||||||
{% for nav_item in nav_item.children %}
|
{% for nav_item in nav_item.children %}
|
||||||
{% if "navigation.indexes" in features and nav_item.is_index %}
|
{% if not indexes or nav_item != indexes | first %}
|
||||||
<!-- Render nothing -->
|
|
||||||
{% else %}
|
|
||||||
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
|
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user