{#- Data-driven landing page. Front matter: template: landing.html hero: eyebrow: "v0.1 ยท local-first" title: "Markdown in.
Docs out." text: "One sentence that sells it." actions: - {text: Get started, link: start/, icon: rocket, primary: true} install: pip install mkdocs-sumi code: {title: mkdocs.yml, lang: yaml, content: "..."} image: assets/hero.png demo: # a Markdown file beside the page it builds (shown under the copy) title: docs/deploy.md url: example.com/deploy/ nav: [Introduction, Install, Deploy] # the mini sidebar; `current` marks one current: Deploy brand: My Project # the demo site's name; then the logo is Sumi's mark markdown: "..." badges: [Free, {text: Stable, tone: tip}] sections: - {type: features, eyebrow, title, text, columns: 3, items: [{icon, title, text, link}]} (items can also carry: mark, meta, badges, bullets, actions) - {type: split, title, text, code: {lang, title, content}, image, reverse: true} - {type: stats, items: [{value, label}]} - {type: steps, title, items: [{title, text}]} - {type: faq, title, items: [{q, a}]} - {type: cta, title, text, actions} - {type: posts, title, limit: 3} # the latest blog posts - {type: markdown, title, markdown: "..."} - {type: content} # the page's Markdown body - {type: content, toc: true} # the body as a docs page, with its table of contents - {type: include, template: partials/my-section.html} # a template from custom_dir Every section takes `id`, `class`, `tone: soft` or `tone: dark`, `markdown` (shown below the section) and `actions` (below that; a cta shows them in the box). -#} {% extends "main.html" %} {%- macro actions(list) -%}
{%- for a in list or [] %} {%- if a.icon %}{{ icon(a.icon) }}{% endif %}{{ a.text }}{% if a.primary %}{{ icon('arrow-right', 'sumi-btn-arrow') }}{% endif %} {%- endfor %}
{%- endmacro -%} {%- macro badges(list) -%} {%- if list %}
{%- for b in list %} {%- set tone = b.tone if b is mapping else None %} {{ (b.text if b is mapping else b) | sumi_md }} {%- endfor %}
{%- endif %} {%- endmacro -%} {%- macro code_card(code) -%}
{% if code.title %}{{ code.title }}{% endif %}
{{ ('`````' ~ (code.lang or 'text') ~ '\n' ~ code.content ~ '\n`````') | sumi_md(true) }}
{%- endmacro -%} {%- macro hero_demo(demo) -%} {%- set items = demo.nav or ['Introduction', 'Install', 'Configure', 'Deploy', 'Reference'] -%} {%- endmacro -%} {%- macro section_head(s) -%} {%- if s.eyebrow or s.title or s.text %}
{%- if s.eyebrow %}
{{ s.eyebrow }}
{% endif %} {%- if s.title %}

{{ s.title | sumi_md }}

{% endif %} {%- if s.text %}

{{ s.text | sumi_md }}

{% endif %}
{%- endif %} {%- endmacro -%} {% block layout %} {%- set hero = page.meta.hero or {} -%} {%- set sections = page.meta.sections or [{'type': 'content'}] -%} {%- include "partials/sidebar.html" %}
{%- if hero.eyebrow %}
{{ hero.eyebrow }}
{% endif %}

{{ (hero.title or page.title or config.site_name) | sumi_md }}

{%- if hero.text or config.site_description %}

{{ (hero.text or config.site_description) | sumi_md }}

{% endif %} {{ badges(hero.badges) }} {{ actions(hero.actions) }} {%- if hero.install %} {%- endif %}
{%- if hero.demo %} {{ hero_demo(hero.demo) }} {%- elif hero.code %}
{{ code_card(hero.code) }}
{%- elif hero.image %}
{%- endif %}
{%- set toc_list = page.toc.items if page and page.toc else [] -%} {%- if toc_list | length == 1 and toc_list[0].level == 1 -%}{%- set toc_list = toc_list[0].children -%}{%- endif -%} {%- for s in sections %} {%- set type = s.type or 'content' %} {%- if type == 'content' and s.toc %} {#- The body as a docs page: the article beside its table of contents. -#} {%- set with_toc = toc_list | length > 0 and 'toc' not in hide %}
{%- if 'actions' not in hide %}
{% include "partials/page-actions.html" %}
{%- endif %} {%- if with_toc %}
{{ icon('list') }}{{ t('on_this_page') }}{{ icon('chevron-down', 'sumi-chevron') }} {% include "partials/toc.html" %}
{%- endif %}
{{ page.content }}
{%- if with_toc %} {%- endif %}
{%- else %}
{%- if type == 'include' %} {{ section_head(s) }} {% include s.template %} {%- elif type == 'content' %}
{{ page.content }}
{%- elif type == 'features' %} {{ section_head(s) }}
{%- for f in s['items'] or [] %} {#- A card with its own buttons is not a link itself: links can't nest. -#} {%- set tag = 'a' if f.link and not f.actions else 'div' %} <{{ tag }} class="sumi-feature"{% if tag == 'a' %} href="{{ f.link | url }}"{% endif %}> {%- if f.meta %}
{%- if f.mark %}{% elif f.icon %}{{ icon(f.icon) }}{% endif %}

{{ f.title | sumi_md }}

{{ f.meta | sumi_md }}
{%- else %} {%- if f.mark %}{% elif f.icon %}{{ icon(f.icon) }}{% endif %}

{{ f.title | sumi_md }}

{%- endif %} {{ badges(f.badges) }} {%- if f.text %}

{{ f.text | sumi_md }}

{% endif %} {%- if f.bullets %}
    {% for b in f.bullets %}
  • {{ icon('check') }}{{ b | sumi_md }}
  • {% endfor %}
{%- endif %} {%- if f.actions %}{{ actions(f.actions) }}{% endif %} {%- if tag == 'a' %}{{ f.more or '' }}{{ icon('arrow-right') }}{% endif %} {%- endfor %}
{%- elif type == 'split' %}
{{ section_head(s) }} {%- if s.bullets %}
    {% for b in s.bullets %}
  • {{ icon('check') }}{{ b | sumi_md }}
  • {% endfor %}
{%- endif %} {%- if s.actions %}{{ actions(s.actions) }}{% endif %}
{%- if s.code %}{{ code_card(s.code) }}{% elif s.image %}{% elif s.markdown %}
{{ s.markdown | sumi_md(true) }}
{% endif %}
{%- elif type == 'stats' %} {{ section_head(s) }}
{%- for st in s['items'] or [] %} {%- if st.link %} {%- else %}
{{ st.label }}
{{ st.value }}
{% endif %} {%- endfor %}
{%- elif type == 'steps' %} {{ section_head(s) }}
    {%- for st in s['items'] or [] %}
  1. {{ st.title }}

    {{ st.text | sumi_md(true) }}
  2. {%- endfor %}
{%- elif type == 'faq' %} {{ section_head(s) }}
{%- for f in s['items'] or [] %}
{{ f.q }}
{{ f.a | sumi_md(true) }}
{%- endfor %}
{%- elif type == 'cta' %}
{{ section_head(s) }} {{ actions(s.actions) }}
{%- elif type == 'posts' %} {{ section_head(s) }} {%- set recent = (sumi.posts or [])[:(s.limit or 3)] %} {%- if recent %} {%- endif %} {%- elif type == 'markdown' %} {{ section_head(s) }} {%- if s.markdown %}
{{ s.markdown | sumi_md(true) }}
{% endif %} {%- endif %} {%- if s.markdown and type not in ('split', 'markdown') %}
{{ s.markdown | sumi_md(true) }}
{%- endif %} {%- if s.actions and type not in ('cta', 'split') %}
{{ actions(s.actions) }}
{%- endif %}
{%- endif %} {%- endfor %}
{% endblock %}