{% macro render_nav_item(nav_item, path, level) %} {% set class = "md-nav__item" %} {% if nav_item.active %} {% set class = class ~ " md-nav__item--active" %} {% endif %} {% if nav_item.children %} {% if "navigation.sections" in features and level == 1 + ( "navigation.tabs" in features ) %} {% set class = class ~ " md-nav__item--section" %} {% endif %}
  • {% set checked = "checked" if nav_item.active %} {% if "navigation.expand" in features and not checked %} {% else %} {% endif %}
  • {% elif nav_item == page %}
  • {% set toc = page.toc %} {% if toc | first is defined and "\x3ch1 id=" in page.content %} {% set toc = (toc | first).children %} {% endif %} {% if toc | first is defined %} {% endif %} {{ nav_item.title }} {% if toc | first is defined %} {% include "partials/toc.html" %} {% endif %}
  • {% else %}
  • {{ nav_item.title }}
  • {% endif %} {% endmacro %} {{ render_nav_item(nav_item, path, level) }}