basalt ships ten shortcodes. They follow a few conventions: every shortcode that wraps a body uses Zola's {% foo() %}…{% end %} form, every parameter is keyword-only, and every shortcode has a no-JS fallback so the page keeps working without scripts.

Sections below: alert · collapsible · em · toc · image · carousel · asciinema · katex · mermaid · project

alert

GitLab-style callout for breaking a fact or warning out of the surrounding prose.

{% alert(kind="warning", title="Data deletion") %}
The following instructions will make your data unrecoverable.
{% end %}
ParameterRequiredNotes
kindyesnote / tip / important / caution / warning. Unknown values fall back to note.
titlenoOverride the default capitalised-kind title.
bodyyesRendered through Zola's markdown filter.

collapsible

Native disclosure widget. <details> under the hood, no JavaScript.

Click to expand

Markdown works in here, including links, lists, and code.

{% collapsible(title="Click to expand", open=false) %}
Body markdown.
{% end %}
ParameterRequiredNotes
titleyesSummary line.
opennotrue to start expanded.
bodyyesMarkdown.

em

Editorial italic accent for hero titles and inline emphasis.

Software engineering from a small shop.

{% em() %}engineering{% end %}

Plain markdown *emphasis* inside an .editorial-hero__title picks up the same colour, so writers can use either form.

toc

Drop-in table of contents from page.toc.

{{ toc(depth=2) }}
ParameterNotes
depth1, 2, or 3. Default 2 (h2 + h3).

Replaces the old extra.toc = true front-matter flag, which was removed in May 2026.

image

Responsive <figure> with optional WebP srcset, caption, lightbox, and float positioning.

basalt homepage
Homepage in light mode.
{{ image(src="/img/screenshot.png", alt="…", caption="…", lightbox=true) }}
ParameterNotes
srcAbsolute site path, page-relative path, or remote URL.
altAccessibility text; defaults to caption.
captionRenders as <figcaption>.
widthsComma-separated px widths for the WebP srcset; default 400,800,1200.
widthSets <img width>.
linkWraps the image in <a href>; takes precedence over lightbox.
lightboxClick-to-enlarge in a <dialog>; without JS the anchor goes to the raw image.
positionleft / right / center for floats.

Horizontal scroll-snap slideshow. JS pauses autoplay on hover; prefers-reduced-motion disables it.

{{ carousel(srcs="/img/a.jpg, /img/b.jpg, /img/c.jpg",
              alts="First, Second, Third",
              caption="A walk through the demo",
              lightbox=true) }}
ParameterNotes
srcsComma-separated image URLs.
altsComma-separated alt strings, aligned with srcs.
captionShared <figcaption>.
lightboxPer-slide click-to-enlarge.
autoplayMilliseconds between slides; disabled under prefers-reduced-motion.

The no-JS fallback is CSS scroll-snap.

asciinema

Lazy asciinema player. Loads the player chunk only when a [data-asciinema-cast] element is on the page; supports mp4 / gif fallbacks for no-JS visitors.

{{ asciinema(cast="/casts/demo.cast", title="A short demo", cols=80, rows=24) }}
ParameterNotes
castPath to the .cast file (required).
titleOptional title in the player chrome.
cols / rowsOptional terminal size hints.
mp4 / gifOptional fallback URLs shown when JS is off.

katex

LaTeX expressions, lazy-loaded when math is detected on the page.

Inline:

Display:

Inline: {% katex() %}E = mc^2{% end %}

Display:
{% katex(block=true) %}
\int_0^\infty e^{-x^2}\,dx = \frac{\sqrt{\pi}}{2}
{% end %}
ParameterNotes
bodyLaTeX expression as the shortcode body.
blocktrue for display mode; default inline.

mermaid

Diagrams via a markdown fence. No shortcode needed. Mermaid loads from jsDelivr only when a fence appears on the page. Diagrams re-render when the theme toggles so the colour palette tracks light/dark.

flowchart LR
  src[markdown fence] --> zola[zola build]
  zola --> html[code data-lang=mermaid]
  html --> js[mermaid-helper.ts]
  js -->|theme-changed| js
  js --> svg[rendered SVG]
```mermaid
flowchart LR
  A --> B --> C
```

project

Live GitHub / GitLab / Gitea / sourcehut card. Fetches repo metadata at build time.

{{ project(link="https://codeberg.org/ttsigg/basalt") }}
ParameterNotes
linkRepo URL (required). Host auto-detected from the domain.
kindForce the fetcher: "github" / "gitlab" / "gitea" / "sourcehut". For self-hosted instances.

Auto-detected hosts: github.com, gitlab.com, codeberg.org, git.sr.ht.