{# Components in this file are used inside markdown content, which is rendered as a Tera template first and *then* processed as markdown (zola >= 0.23). Their HTML output must therefore stay markdown-safe: no blank lines in the middle of an HTML block, and no lines indented by 4+ spaces. #} {% component back_link(path: string, config) %}
{% endcomponent back_link %} {% component quote(cite: string = "") -%} {%- set icon = load_data(path="icon/quote.svg") -%}
{{ body | markdown | trim | safe }}
{%- if cite -%} {%- set from_text = "— " ~ cite -%}
{{ from_text | markdown | trim | safe }}
{%- endif -%}
{%- endcomponent quote %} {% component detail(title: string = "", default_open: bool = false) -%} {{ title }} {{ body | markdown | trim | safe }} {%- endcomponent detail %} {% component figure(src: string, alt: string = "", caption: string = "", width: string = "", height: string = "", page = {}, section = {}) -%} {%- if src is starting_with(pat="/") or src is starting_with(pat="http://") or src is starting_with(pat="https://") or src is starting_with(pat="//") or src is starting_with(pat="data:") -%} {%- set image_src = src -%} {%- elif page?.colocated_path -%} {%- set image_src = get_url(path=page.colocated_path ~ src) -%} {%- elif section?.colocated_path -%} {%- set image_src = get_url(path=section.colocated_path ~ src) -%} {%- else -%} {%- set image_src = src -%} {%- endif -%}
{%- if caption -%}
{{ caption | trim | markdown | trim | safe }}
{%- endif -%}
{%- endcomponent figure %} {% component mermaid() -%}
{{ body }}
{%- endcomponent mermaid %} {% component youtube(id: string, autoplay: bool = false) -%}
{%- endcomponent youtube %}