{% extends "main.html" %} {#- Home page renderer — content/presentation split. ALL copy lives in the page frontmatter (docs/index.md / docs/index.zh.md, key `home:`), one block per locale; this template is a pure rendering engine. Section schema: hero: {badge, title(html), subtitle, install, primary:{label,ref}, secondary:{label,url}} sections: list of cards: {title, subtitle?, lead(html)?, command?, muted?, two?, cards:[{icon, title, text(html), bullets?:[{text(html)}|{label,ref}], link?:{label,ref}, chip?}]} comparison: {title, subtitle?, muted?, stack?, bad:{title, code}, good:{title, code}, deliveries?:[{icon, title, text, code}]} integrations:{title, subtitle?, badges:[{icon, label, ref}]} cta: {title, subtitle, primary:{label,ref}, secondary:{label,url}} `ref` values are docs page refs passed through the `url` filter; `url` values are absolute links. HTML is allowed in text/lead/title fields. -#} {% macro feature_card(c) %}
{{ c.icon }}

{{ c.title }}

{{ c.text }}{% if c.link %} {{ c.link.label }}{% endif %}

{% if c.bullets %} {% endif %} {% if c.chip %}{{ c.chip }}{% endif %}
{% endmacro %} {% macro section_header(s) %}

{{ s.title }}

{% if s.subtitle %}

{{ s.subtitle }}

{% endif %}
{% endmacro %} {% macro cards_section(s) %}
{{ section_header(s) }} {% if s.lead %}

{{ s.lead }}

{% endif %} {% if s.command %}
{{ s.command }}
{% endif %}
{% for c in s.cards %}{{ feature_card(c) }}{% endfor %}
{% endmacro %} {% macro code_panel(kind, p) %}
{{ p.title }}
{{ p.code }}
{% endmacro %} {% macro comparison_section(s) %}
{{ section_header(s) }}
{{ code_panel("bad", s.bad) }} {{ code_panel("good", s.good) }}
{% if s.deliveries %}
{% for d in s.deliveries %}
{{ d.icon }}

{{ d.title }}

{{ d.text }}

{{ d.code }}
{% endfor %}
{% endif %}
{% endmacro %} {% macro integrations_section(s) %}
{{ section_header(s) }}
{% for b in s.badges %} {{ b.icon }} {{ b.label }} {% endfor %}
{% endmacro %} {% macro cta_section(s) %}

{{ s.title }}

{{ s.subtitle }}

{% endmacro %} {% block tabs %} {{ super() }} {% set home = page.meta.home if page.meta else none %} {% if home %}
{{ home.hero.badge }}

{{ home.hero.title }}

{{ home.hero.subtitle }}

{{ home.hero.install }}
{% for s in home.sections %} {% if s.type == "cards" %}{{ cards_section(s) }} {% elif s.type == "comparison" %}{{ comparison_section(s) }} {% elif s.type == "integrations" %}{{ integrations_section(s) }} {% elif s.type == "cta" %}{{ cta_section(s) }} {% endif %} {% endfor %}
{% else %}
Home content missing: add a home: block to this page's frontmatter.
{% endif %} {% endblock %} {% block content %}{% endblock %} {% block footer %}{% endblock %}