{# ================================================================================ Navigation Menu Macros - REFERENCE ONLY ================================================================================ NOTE: These macros are now defined INLINE in base.html because Jinja2's {% from ... import %} doesn't work with template inheritance - child templates that extend base.html don't inherit the imported macros. This file is kept as documentation/reference for the macro signatures. The actual macros are defined at the top of base.html. See: plan/active/rfc-template-performance-optimization.md ================================================================================ #} {# Render manual menu items from config. Args: menu: List of menu item dicts from get_menu_lang() is_mobile: If true, adds 'has-submenu' class for mobile styling #} {% def render_menu_items(menu, is_mobile=false) %} {% if menu %} {% spaceless %} {% for item in menu %}
  • {{ item.name }} {% if item.children %} {% end %}
  • {% end %} {% end %} {% end %} {% end %} {# Render auto-discovered navigation items. Args: auto_nav: List of auto-discovered nav items from get_auto_nav() page_url: Current page URL for active state detection #} {% def render_auto_nav(auto_nav, page_url) %} {% if auto_nav %} {# Always show Home first in auto mode #}
  • Home
  • {% for item in auto_nav %}
  • {{ item.name }}
  • {% end %} {% end %} {% end %} {# Render GitHub link if configured and not bundled in Dev menu. Args: site: Site object with config is_mobile: If true, uses mobile styling with inline SVG margin #} {% def render_github_link(site, is_mobile=false) %} {% set github_bundled = false %} {% if site._dev_menu_metadata %} {% set github_bundled = site._dev_menu_metadata.get("github_bundled", false) %} {% end %} {% if config.params and config.params.repo_url and not github_bundled %}
  • {% if is_mobile %} {{ icon('github-logo', size=16, css_class='nav-icon') }} GitHub {% else %} {{ icon('github-logo', size=16) }} GitHub {% end %}
  • {% end %} {% end %} {# Render logo/brand element. Args: site: Site object with config site_title: Pre-cached site title #} {% def render_logo(site, site_title) %} {% set _logo_image = site.logo_image or site.logo %} {% set _logo_text = site.logo_text or site.title %} {% if _logo_image %} {{ site_title }} {% elif _logo_text %} {{ _logo_text }} {% else %} {{ site_title }} {% end %} {% end %}