{% macro toc_item(item) %} {#- if item.level <= config.theme.navigation_depth #}
  • {{ item.title }} {% if item.level <= config.theme.navigation_depth + 1 %}
      {{ '
      ' if item.level == 1 }} {%- for child in item.children %} {% if child.level <= config.theme.navigation_depth %} {{- toc_item(child) }} {% endif %} {%- endfor %}
    {% endif %}
  • {#- endif #} {%- endmacro %}
      {% if page and page.meta.custom_toc %} {%- for item in page.meta.custom_toc %} {%- if item.level <= config.theme.navigation_depth %} {{ toc_item(item) }} {% endif %} {%- endfor %} {# elif 'Functions' in page.file.abs_src_path #} {% else %} {#- for item in page.toc #} {%- for item in page|sidebar(pages) %} {{ toc_item(item) }} {%- endfor %} {% endif %}