{# Renders the global document toctree on every page (including the
   landing page) with pydata-sphinx-theme's collapsible chevrons.

   The stock sidebar-nav-bs.html starts at the current section and is
   stripped from the sidebar list by suppress_sidebar_toctree() on the
   root page (no parent section). Using generate_toctree_html with
   startdepth=0 renders the whole tree from root with the bootstrap
   classes the theme's JS uses for expand/collapse toggles. Naming the
   template "sidebar-globaltoc" sidesteps the suppress filter, which
   matches on "sidebar-nav-bs.html" specifically. #}
<nav class="bd-docs-nav bd-links" aria-label="{{ _('Section Navigation') }}">
  <p class="bd-links__title" role="heading" aria-level="1">{{ _("Section Navigation") }}</p>
  <div class="bd-toc-item navbar-nav">
    {# collapse=False so nested <ul>s render into the DOM for every
       branch; the theme's JS then adds the expand/collapse chevrons
       on top. show_nav_level is driven by theme_show_nav_level (set
       in conf.py) so callers can adjust how deep the sidebar opens
       by default without editing this template. #}
    {{- generate_toctree_html(
      "sidebar",
      startdepth=0,
      show_nav_level=theme_show_nav_level | int,
      maxdepth=theme_navigation_depth | int,
      collapse=False,
      includehidden=True,
      titles_only=True
      )
    -}}
  </div>
</nav>
