Formatting

This commit is contained in:
squidfunk 2021-02-25 17:51:38 +01:00
parent 7d5a463c60
commit dd3a4788cb
2 changed files with 7 additions and 17 deletions

View File

@ -1,7 +1,7 @@
{#-
This file was automatically generated - do not edit
-#}
{% macro render_nav_item(nav_item, path, level) %}
{% macro render(nav_item, path, level) %}
{% set class = "md-nav__item" %}
{% if nav_item.active %}
{% set class = class ~ " md-nav__item--active" %}
@ -29,13 +29,8 @@
{{ nav_item.title }}
</label>
<ul class="md-nav__list" data-md-scrollfix>
{% set base = path %}
{% for nav_item in nav_item.children %}
{{ render_nav_item(
nav_item,
path = base ~ "_" ~ loop.index,
level = level + 1)
}}
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
{% endfor %}
</ul>
</nav>
@ -68,4 +63,4 @@
</li>
{% endif %}
{% endmacro %}
{{ render_nav_item(nav_item, path, level) }}
{{ render(nav_item, path, level) }}

View File

@ -20,8 +20,8 @@
IN THE SOFTWARE.
-->
<!-- Wrap everything into a macro to reduce file roundtrips (see #2213) -->
{% macro render_nav_item(nav_item, path, level) %}
<!-- Wrap everything with a macro to reduce file roundtrips (see #2213) -->
{% macro render(nav_item, path, level) %}
<!-- Determine class according to state -->
{% set class = "md-nav__item" %}
@ -80,13 +80,8 @@
<ul class="md-nav__list" data-md-scrollfix>
<!-- Render nested item list -->
{% set base = path %}
{% for nav_item in nav_item.children %}
{{ render_nav_item(
nav_item,
path = base ~ "_" ~ loop.index,
level = level + 1)
}}
{{ render(nav_item, path ~ "_" ~ loop.index, level + 1) }}
{% endfor %}
</ul>
</nav>
@ -141,4 +136,4 @@
{% endmacro %}
<!-- Render current and nested navigation items -->
{{ render_nav_item(nav_item, path, level) }}
{{ render(nav_item, path, level) }}