Liquid Hello World embed template file



examples/liquid/liquid-hello-world-embedded-file/src/main.rs
fn main() {
    let template = include_str!("../template.txt");
    let template = liquid::ParserBuilder::with_stdlib()
        .build()
        .unwrap()
        .parse(template)
        .unwrap();

    let name = String::from("Liquid");
    let globals = liquid::object!({
        "name": name
    });
    let output = template.render(&globals).unwrap();
    println!("{}", output);
}

examples/liquid/liquid-hello-world-embedded-file/template.txt
Hello {{name}}!