blob: 7519857271e96a2e06a9e8fb819af089f1d09005 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
<h2>All Blogposts</h2>
{% macro nav_tree(nav) -%}
<ul>
{% for nav_item in nav %}
{% if not nav_item.children %}
<li>
<a href="{{ nav_item.url }}">{{ nav_item.title }}</a>
</li>
{% else %}
<li>
{# HACK: children[0] is the category index, and [1:] are its pages #}
<a href="{{ nav_item.children[0].url }}">{{ nav_item.children[0].title }}</a>
{{ nav_tree(nav_item.children[1:]) }}
</li>
{% endif %}
{% endfor %}
</ul>
{%- endmacro %}
{{ nav_tree(nav) }}
|