grav/themes/quark/templates/macros/macros.html.twig

16 lines
422 B
Twig
Raw Normal View History

2023-01-09 02:00:36 +01:00
{% macro nav_loop(page) %}
{% import _self as macros %}
{% for p in page.children.visible %}
{% set active_page = (p.active or p.activeChild) ? 'active' : '' %}
<li>
<a href="{{ p.url }}" class="{{ active_page }}">
{{ p.menu }}
</a>
{% if p.children.visible.count > 0 %}
<ul>
{{ macros.nav_loop(p) }}
</ul>
{% endif %}
</li>
{% endfor %}
{% endmacro %}