2023-05-16 14:20:01 +00:00
|
|
|
use handlebars::Handlebars;
|
2023-05-11 17:34:05 +00:00
|
|
|
|
|
|
|
#[derive(rust_embed::RustEmbed)]
|
2023-06-18 12:53:25 +00:00
|
|
|
#[folder = "src/service/http/tpl"]
|
2023-05-11 17:34:05 +00:00
|
|
|
#[prefix = "/"]
|
|
|
|
struct Dir;
|
|
|
|
|
2023-06-18 13:10:06 +00:00
|
|
|
pub fn get() -> Handlebars<'static> {
|
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
|
|
|
}
|