{# Documentation Navigation Section Component (Recursive) Renders an individual section with pages and subsections in the docs nav tree. Variables: - section: Section object to render (required) - section.title: Section title - section.url: Section URL - section.index_page: Section index page (optional) - section.sorted_pages: Pages in section (pre-sorted by weight) - section.sorted_subsections: Subsections (pre-sorted by weight) - depth: Current nesting depth for styling (required) - page: Current page object (for active highlighting) Features: - Collapsible section with toggle button - Clickable section header (links to index page) - Active page highlighting - Recursive rendering of subsections - Smart title display (extracts short names from dotted titles) Note: This component calls itself recursively for subsections. Included by 'partials/docs-nav.html'. Usage: {% set depth = 0 %} {% include 'partials/docs-nav-section.html' %} #}
{# Section Toggle Button - with link functionality #}
{# Normalize current page URL for exact matching (remove trailing slash) #} {# Use relative_url for comparisons (without baseurl) #} {% set current_url = page.relative_url.rstrip('/') if (page is defined and page and page.relative_url) else '' %} {% if section.index_page %} {% set section_url_normalized = section.index_page.relative_url.rstrip('/') if section.index_page.relative_url else '' %} {% set section_title = section.title if section.title and section.title.strip() else (section.slug.replace('-', ' ').replace('_', ' ').title() if section.slug else 'Section') %} {{ section_title }} {% else %} {% set section_title = section.title if section.title and section.title.strip() else (section.slug.replace('-', ' ').replace('_', ' ').title() if section.slug else 'Section') %} {{ section_title }} {% endif %}
{# Section Items #}