{# 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). #} {%- 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. #}