roxy-docs/includes/macros.html
kitsunecafe b040598c56 initial
2024-02-20 06:43:51 -05:00

24 lines
747 B
HTML

{% macro menu_items(key="") %}
{% for page in pages | get(key=key, default=pages) | unzip | filter(attribute="1.order") | sort(attribute="1.order") %}
{% set parent = key %}
{% set key = page.0 %}
{% set value = page.1 %}
{% if value.type and value.type == "page" %}
<li><a href="{{value.path}}">{{value.title}}</a></li>
{% elif value.type and value.type == "category" %}
{% set next = [parent, key] | join(sep=".") | trim_start_matches(pat=".") %}
</menu>
<details open>
<summary>
{{value.title}}
</summary>
<menu class="menu-item-list">
{{ self::menu_items(key=next) }}
</menu>
</details>
<menu class="menu-item-list">
{% endif %}
{% endfor %}
{% endmacro category %}