Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
squidfunk committed Feb 25, 2021
1 parent 7d5a463 commit dd3a478
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
11 changes: 3 additions & 8 deletions material/partials/nav-item.html
@@ -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" %}
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -68,4 +63,4 @@
</li>
{% endif %}
{% endmacro %}
{{ render_nav_item(nav_item, path, level) }}
{{ render(nav_item, path, level) }}
13 changes: 4 additions & 9 deletions src/partials/nav-item.html
Expand Up @@ -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" %}
Expand Down Expand Up @@ -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>
Expand Down Expand Up @@ -141,4 +136,4 @@
{% endmacro %}

<!-- Render current and nested navigation items -->
{{ render_nav_item(nav_item, path, level) }}
{{ render(nav_item, path, level) }}

0 comments on commit dd3a478

Please sign in to comment.