Functions available to theme templates.
Templates opt in with <% import Cherry.Theme.Helpers %> at the top —
explicit, visible to theme authors, no hidden magic in the renderer.
Summary
Functions
The CV bullets for an entry: the cv: block's curated highlights win
over the timeline ones (curation, not duplication — DESIGN.md §4).
Formats a date for display, e.g. January 15, 2026.
Formats a month for display, e.g. Apr 2015.
A date span: Jan 2020 — present, Jan 2020 — May 2022, or "".
Escapes text for safe interpolation into HTML.
Site-rooted href for an output-relative location — respects base_path.
URL-safe slug for a tag name.
Functions
@spec cv_highlights(%{ cv: Cherry.Portfolio.Curation.t() | nil, highlights: [String.t()] }) :: [ String.t() ]
The CV bullets for an entry: the cv: block's curated highlights win
over the timeline ones (curation, not duplication — DESIGN.md §4).
Formats a date for display, e.g. January 15, 2026.
Formats a month for display, e.g. Apr 2015.
A date span: Jan 2020 — present, Jan 2020 — May 2022, or "".
@spec h(String.Chars.t()) :: String.t()
Escapes text for safe interpolation into HTML.
@spec href(Cherry.Site.t(), String.t()) :: String.t()
Site-rooted href for an output-relative location — respects base_path.
href(@site, "blog/") #=> "/blog/" or "/repo/blog/"
URL-safe slug for a tag name.