module

Hwaro::Content::Processors::RenderHooks

Constants

HOOK_NAMES = {"link", "image", "heading", "codeblock", "blockquote", "table"}

The six render hooks implemented today.

Class methods

configure(templates : Hash(String, String), template_paths : Hash(String, String)) : Nil

(Re)builds the hook registry from the loaded template set. Called from load_templates (Initialize phase) right after @template_deps = TemplateDeps.new(templates), so it re-runs on every serve template reload exactly like the dependency graph does.

Source
fallback_context(page : Models::Page, config : Models::Config) : HookRenderContext | Nil

A HookRenderContext for feed/search fallback rendering, or nil when no registry is configured. Builds a minimal page/config variable set from page + config directly (no access to the render phase's per-worker env/global vars).

Source
page_vars(page : Models::Page, config : Models::Config) : Hash(String, Crinja::Value)

Shared page/config variable builder — exactly 6 leaf values, used by both the render-phase context (render.cr#build_hook_render_context) and this fallback context.

Source
registry

The active hook registry, or nil when no templates/hooks/render-* template exists — the zero-cost gate every hook-aware call site checks before doing any extra work.

Source

Nested types