blog/templates/macros/post.html

13 lines
352 B
HTML
Raw Permalink Normal View History

2018-09-22 08:17:41 +00:00
{% macro render_toc(toc) %}
<ul>
{% for item in toc %}
<li>
<a href="{{ item.permalink | safe }}">{{ item.title }}</a>
{% if item.children %}
2018-10-19 16:10:28 +00:00
{{ post::render_toc(toc=item.children) }}
2018-09-22 08:17:41 +00:00
{% endif %}
</li>
{% endfor %}
</ul>
{% endmacro %}