sailfish/examples/include.rs

17 lines
316 B
Rust

use sailfish::RenderOnce;
#[derive(RenderOnce)]
#[template(path = "include.stpl")]
struct Include {
title: String,
name: String,
}
fn main() {
let ctx = Include {
title: "Website".to_owned(),
name: "Hanako".to_owned(),
};
println!("{}", ctx.render_once_to_string().unwrap());
}