Skip to main content

register_tera_function

Function register_tera_function 

Source
pub fn register_tera_function(tera: &mut Tera)
Expand description

Register the cms_snippet Tera function. Wired from crate::urls::register_tera_helpers.

{{ cms_snippet(slug="hero-cta") }} is the snippet’s rendered body in its wrapper; body=true gives the body alone. An unknown slug is an empty string. Tera functions can’t read the context, so the maps come from the thread-local the public render installs.