diff options
Diffstat (limited to 'src/templates/mod.rs')
-rw-r--r-- | src/templates/mod.rs | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/templates/mod.rs b/src/templates/mod.rs index 3a6eb2b..534ada0 100644 --- a/src/templates/mod.rs +++ b/src/templates/mod.rs @@ -1,9 +1,16 @@ -pub static INDEX_T: &str = include_str!("index.html"); -pub static LOGIN_T: &str = include_str!("login.html"); -pub const CATALOG_L: &str = "/#menu"; -pub const PARTS_L: &str = "/parts"; -pub const PARTS_CSV_L: &str = "/parts.csv"; -pub const CARS_L: &str = "/cars"; -pub const CARS_CSV_L: &str = "/cars.csv"; -pub const SUGGESTIONS_L: &str = "/suggestions"; -pub const LOGIN_L: &str = "/login"; +use handlebars::Handlebars; +use once_cell::sync::Lazy; + +pub static REGISTRY: Lazy<Handlebars> = Lazy::new(|| { + let mut handlebars = Handlebars::new(); + handlebars + .register_template_string("index", include_str!("index.hbs")) + .unwrap(); + handlebars + .register_template_string("login", include_str!("login.hbs")) + .unwrap(); + handlebars + .register_template_string("base", include_str!("base.hbs")) + .unwrap(); + handlebars +}); |