module

Templates

Class methods

constants_for(lang) : Hash(String, Crinja::Value)

The build-constant site variables templates see (per language), used by TemplatePreprocessor to fold constant subtrees at load time. Keep in sync with Render.apply_template's site vars.

Source
ensure_shortcodes

Ensure all baked-in shortcodes exist in the shortcodes/ directory If any are missing, extract them from the baked filesystem

Source
ensure_theme

Ensure all baked-in theme files exist in the themes/default/ directory If any are missing, extract them from the baked filesystem

Source
environment

Get the Crinja environment for the current task, checking one out of the pool on first use (see EnvCache). Calls outside a task simply keep their environment checked out for the fiber's lifetime.

Source
get_deps(template)

Compute the kv:// dependencies of a template file: every other template it references through {% include %}, {% extends %}, {% import %} or {% from ... import %}.

Source
get_template(name : String, lang : String) : Crinja::Template

The (folded) template for name in lang on the current fiber's environment

Source
load_templates

Load templates from theme directory and put them in the k/v store

Source
resolve_template_key(reference : String) : String

Resolve a template reference as written in a tag (see DependencyVisitor) to the key it is stored under, using the same rules as Templates::StoreLoader

Source

Nested types