{# ============================================================================= components/sidebar.html — Reusable Sidebar Navigation Component ============================================================================= A macro-based sidebar component that renders nav_items with: • Group headings (when items share a "group" frontmatter key) • Active page highlighting • Directory vs. file icons • External link handling (target="_blank") This component can be imported from any template. Usage: {% from 'components/sidebar.html' import sidebar_nav %} {{ sidebar_nav(nav_items=nav_items) }} Required: nav_items – list of dicts from Moosey's get_files() or the built-in nav_items global. Each item must have: .name, .url, .is_active, .is_dir, .target, .group ============================================================================= #} {# sidebar_nav macro ----------------- Renders a full sidebar navigation list from Moosey nav_items. Parameters: nav_items – list of navigation item dicts (required) title – section heading text (default: "In this section") #} {% macro sidebar_nav(nav_items=[], title='In this section') %} {% if nav_items %} {% else %} {# When nav_items is empty (single page or no siblings), show a placeholder message. You could also hide the sidebar entirely by checking {% if nav_items %} before calling this macro. #}

No other pages here.

{% endif %} {% endmacro %}