{# Recursive: nav depth is unbounded, so a section includes this same template for each of its children. The inner `for` rebinds `nav_item` in loop scope, which is what makes the recursion work (same trick as mkdocs-basic-theme). #} {# How deep this item sits, counted from the top of the tree. The stylesheet spends it on the label's padding rather than on the container holding the items, so a nested row keeps the full width of the list and every fill and every current-item bar in the tree stands on the same left edge. `include` hands the included template a copy of this context, which is what carries the count down; a copy is also why nothing assigned in there comes back up. #} {%- set depth = depth | default(0) %} {%- if nav_item.children %} {# `data-primer-nav-open` is the section's expanded state, and the only one. The stylesheet hides the children of a section without it once the document is known to be scriptable, and js/nav-sections.js moves the attribute when the reader works the toggle. With no JavaScript nothing is hidden and every section stays open, which is what this nav did before. #}