about summary refs log tree commit diff stats
path: root/templates/macros.html
blob: 571c6e0326b6b8dfd59ac7e636808838363455f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
{%- macro table_of_contents(toc, max_level) %}
<ul>
  {%- for header in toc %}
    <li>
      <a href="{{ header.permalink | safe }}">{{ header.title }}</a>
        {%- if header.children and header.level < max_level %}
          {{- self::table_of_contents(toc=header.children, max_level=max_level) | indent() | safe() }}
        {%- endif %}
    </li>
  {%- endfor %}
</ul>
{%- endmacro %}