{# Keep every section when a reference page has several top-level headings. #} {% macro section_links(sections, depth) -%} {% for section in sections -%}
  • {{ section.title }} {% if section.children and depth < config.theme.navigation_depth -%} {%- endif %}
  • {%- endfor %} {%- endmacro %} {% if nav_item.toc.items|length > 1 -%} {{ section_links(nav_item.toc.items, navlevel) }} {%- else -%} {{ section_links(toc_item.children, navlevel) }} {%- endif %}