Skip to main content

render_template

Function render_template 

Source
pub fn render_template(
    tera: &Tera,
    template_name: &str,
    ctx: &Context,
) -> Result<String, Error>
Expand description

Render template_name with ctx, falling back to rendering only the content block when the context has render_partial == true.

Tera 2 no longer allows {% block %} inside {% if %}, so the partial vs. full page decision is made here in Rust instead of inside base.html.