2023-05-16 14:20:01 +00:00
|
|
|
use handlebars::Handlebars;
|
2023-05-11 17:34:05 +00:00
|
|
|
|
|
|
|
#[derive(rust_embed::RustEmbed)]
|
|
|
|
#[folder = "src/service/http_tpl"]
|
|
|
|
#[prefix = "/"]
|
|
|
|
struct Dir;
|
|
|
|
|
2023-05-16 14:20:01 +00:00
|
|
|
pub fn get<'hbs>() -> Handlebars<'hbs> {
|
2023-05-11 17:34:05 +00:00
|
|
|
let mut reg = Handlebars::new();
|
2023-05-16 14:20:01 +00:00
|
|
|
reg.register_embed_templates::<Dir>()
|
|
|
|
.expect("registered embedded templates");
|
|
|
|
reg
|
2023-05-11 17:34:05 +00:00
|
|
|
}
|