{% macro render_toc(items, max_depth, current_depth=1) %} {% for item in items %}
  • {{ item.title }} {% if item.children and current_depth < max_depth %} {% endif %}
  • {% endfor %} {% endmacro %} {% macro render_parent_link(current_path) %} {% if "/" in current_path %} {% set last_char = current_path | split(pat="/") | last %} {% if last_char == "" %} {% set parent_dirs = current_path | split(pat="/") | slice(end=-2) %} {% else %} {% set parent_dirs = current_path | split(pat="/") | slice(end=-1) %} {% endif %} {% set parent_href = parent_dirs | join(sep="/") %} Parent {% endif %} {% endmacro %}