2023-05-11 17:34:05 +00:00
|
|
|
use handlebars::{Handlebars, TemplateError};
|
|
|
|
|
|
|
|
#[derive(rust_embed::RustEmbed)]
|
|
|
|
#[folder = "src/service/http_tpl"]
|
|
|
|
#[prefix = "/"]
|
|
|
|
struct Dir;
|
|
|
|
|
2023-05-15 15:42:32 +00:00
|
|
|
pub fn get<'hbs>() -> Result<Handlebars<'hbs>, TemplateError> {
|
2023-05-11 17:34:05 +00:00
|
|
|
let mut reg = Handlebars::new();
|
|
|
|
reg.register_embed_templates::<Dir>()?;
|
|
|
|
Ok(reg)
|
|
|
|
}
|