section-icons

Semantic icon resolvers — section(slug), tradition(slug), event_type(slug), render(id). All consult data/icons.json.

≈ 2 min read 242 words Updated 2026-08-23

On this page

macros/section-icons.html is the single entry point for rendering icons across Bifrost. Four resolver macros expose semantic lookups (section, tradition, event-type) plus a by-id renderer.

Source: themes/bifrost/templates/macros/section-icons.html · registry: data/icons.json · live registry: Reference → Icons

Public API#

{%/* import "macros/section-icons.html" as section_icons */%}

{# Semantic resolvers — slug → icon via data/icons.json bindings #}
{{ section_icons::section(slug="library") }}
{{ section_icons::tradition(slug="raelian") }}
{{ section_icons::event_type(slug="announcement") }}

{# Generic by-id renderer #}
{{ section_icons::render(id="arrow-right") }}

Adding a new icon#

  1. Drop the SVG into templates/partials/icons/<id>.html.
  2. Add an entry under icons in data/icons.json (family, source, viewBox, usage).
  3. Add a render-branch in the relevant macro below.

Adding a new binding#

For a new tradition slug, event-type slug, etc.:

  1. Edit bindings in data/icons.json.
  2. Ensure the chosen icon_id has a render-branch in the matching resolver macro.

Why each macro has its own if-elif chain#

Tera doesn’t support computed include paths (you can’t pass a variable to {%/* include */%}), and Tera 1.x stack-overflows on self-import — so delegating semantic resolvers to a shared render(id) macro in the same file isn’t possible. The duplication is small: each kind-macro only branches on the icons actually bound to that kind.

Edit this page on GitHub