{# Page Hero - Dispatcher Routes to the appropriate page hero variant based on configuration. Variants: - editorial: Clean magazine layout without container styling (default for single pages) - overview: Section index pages with page count instead of read time (default for list pages) - magazine: Editorial-style consolidated header with container/background - classic: Traditional separate action-bar + page-header Configuration: - Site-wide: theme.hero_style in bengal.toml - Per-page: variant (new) or hero_style (legacy) in frontmatter (overrides site-wide) Usage: {% include 'partials/page-hero.html' %} #} {# Determine hero style: page variant > page frontmatter > template default > theme config > default (editorial) #} {# Priority: variant (PageCore) > hero_style (PageCore/Metadata) > _list_hero_default > theme config > editorial #} {% set _page_variant = page.variant if (page is defined and page) else none %} {% set _page_hero_style = page.metadata.get('hero_style') if (page.metadata is defined and page.metadata) else none %} {% set _template_default = _list_hero_default if _list_hero_default is defined else none %} {% set _theme_hero_style = site.theme_config.hero_style if (site.theme_config is defined and site.theme_config.hero_style is defined) else 'editorial' %} {# Resolve effective variant #} {% set hero_style = _page_variant if _page_variant else (_page_hero_style if _page_hero_style else (_template_default if _template_default else _theme_hero_style)) %} {% if hero_style == 'magazine' %} {% include 'partials/page-hero-magazine.html' %} {% elif hero_style == 'classic' %} {% include 'partials/page-hero-classic.html' %} {% elif hero_style == 'overview' %} {% include 'partials/page-hero-overview.html' %} {% elif hero_style == 'api' %} {# Route to appropriate separated template based on whether element exists #} {% if element is defined and element %} {% include 'partials/page-hero/element.html' %} {% elif section is defined and section %} {% include 'partials/page-hero/section.html' %} {% else %} {# Fallback to editorial: API hero requires element/section context; without it we cannot render an API-specific layout, so we use the standard editorial hero as the safe, context-agnostic default. #} {% include 'partials/page-hero-editorial.html' %} {% endif %} {% else %} {# Default to editorial #} {% include 'partials/page-hero-editorial.html' %} {% endif %}