Macro minijinja_embed::load_templates

source ·
macro_rules! load_templates {
    ($env:expr, $bundle_name:literal) => { ... };
    ($env:expr) => { ... };
}
Expand description

Loads embedded templates into the environment.

This macro takes a MiniJinja environment as argument and optionally also the name of a template bundle. All templates in the bundle are then loaded into the environment. Templates are eagerly loaded into the environment which means that no loader needs to be enabled.

minijinja_embed::load_templates!(&mut env);

By default the main bundled is loaded. To load a different one pass it as second argument:

minijinja_embed::load_templates!(&mut env, "other_bundle");