{#- Tabs with submenus. The stock partial renders a section as a single link to its index page and drops the children, so on a wide screen the whole top navigation is six words and every page below the first level is reachable only from the sidebar. This renders the children as a menu under their tab. `navigation.indexes` promotes a section's index page to the section itself, exactly as the sidebar does, so the tab link and the sidebar entry lead to the same page and the index is not repeated inside the menu. Sections nested one level deeper (the rule categories) become a labelled group rather than being flattened, so the menu keeps the sidebar's shape. The index is tracked as an *item*, never as its URL: the site root's index page has an empty URL, so testing the URL for truthiness silently treats the root section as having no index and promotes its second page into the tab. That is how the Overview tab came to point at `/security/`. -#} {% macro render_content(nav_item, ref) %} {% set ref = ref or nav_item %} {{ ref.title or nav_item.title }} {% endmacro %} {#- One entry in a tab's menu: a page, or a nested section as a group. -#} {% macro render_entry(item) %} {% if item.children %} {% set inner = namespace(index = none) %} {% if "navigation.indexes" in features %} {% for child in item.children %} {% if child.is_index and inner.index is none %} {% set inner.index = child %} {% endif %} {% endfor %} {% endif %}