{# This component is used inside markdown content, which is rendered as a Tera template first and *then* processed as markdown (zola >= 0.23). Its HTML output must therefore stay markdown-safe: no blank lines in the middle of an HTML block, and no lines indented by 4+ spaces. Collection file schema: layout = "card" | "row" | "tile" | "gallery" (default "card") flow = "stack" | "inline" | "grid" (default: card/gallery -> "stack", row/tile -> "inline") [[item]] title / subtitle / content / icon / image / link / badge / tags / featured / rotate #} {% component collection(file: string, section) -%} {%- set data = load_data(path="content" ~ section.path ~ file, format="toml") -%} {%- set layout = data.layout if data.layout is defined else "card" -%} {%- if layout not in ["card", "row", "tile", "gallery"] -%} {%- set layout = "card" -%} {%- endif -%} {%- if data.flow is defined and data.flow in ["stack", "inline", "grid"] -%} {%- set flow = data.flow -%} {%- elif layout == "row" or layout == "tile" -%} {%- set flow = "inline" -%} {%- else -%} {%- set flow = "stack" -%} {%- endif -%} {%- if layout == "card" and flow == "inline" -%} {%- set flow = "grid" -%} {%- endif -%}