Tera macros

Server-side render helpers in Bifrost — imported into templates with `{%/* import */%}` and called as `namespace::name(args)`.

12 pages in this section

Tera macros live in themes/bifrost/templates/macros/. They are server-side render helpers — Zola executes them at build time, no client-side runtime involved. Templates import them at the top and call them by namespace:

{%/* import "macros/breadcrumbs.html" as breadcrumbs */%}

{{ breadcrumbs::wiki(page=page, lang=detected_lang) }}

The macro layer is where most of the cross-template consistency lives — breadcrumb structure, badge rendering, link wrapping. Adding a new macro means changes propagate to every template that imports it.

  • breadcrumbs Render breadcrumb navigation with schema.org BreadcrumbList markup. One convenience macro per section type.
  • claim-badge Renders the four-badge claim-type row with the page's claim_type highlighted. Single macro.
  • dispatch Render helpers for the Newsroom section — chip, card, lead card, attribution row.
  • article Render helpers for the Articles (Explainers) section — chip, card, lead card.
  • library Per-book metadata lookup macros — language-aware title, subtitle, description accessors that fall back through (lang → en → primaryLang).
  • relatedness-graph Bounded SVG 'neighbourhood' mini-graph rendered above the See also list on wiki and article pages. Single macro.
  • section-icons Semantic icon resolvers — section(slug), tradition(slug), event_type(slug), render(id). All consult data/icons.json.
  • translation-badge Renders the per-entry translation-status pill in the wiki sidebar — only on non-English pages with a known status.
  • image Responsive `<picture>` element generator targeting AVIF and WebP sources on the assets CDN.
  • link Two link-render macros: `smart_link` (auto-detects external) and `footer_link` (internal i18n).
  • zodiac Hand-drawn SVG zodiac-sign glyphs — one macro covering all twelve signs, stroke-based, inherits `currentColor`.
  • wiki + explainer + author helpers Per-section render-helper modules: TOC items, reference entries, author profile cards. Bundled together because each is a small handful of macros used only inside its section template.

Edit this page on GitHub