diff options
author | Adam T. Carpenter <atc@53hor.net> | 2021-04-09 18:50:55 -0400 |
---|---|---|
committer | Adam T. Carpenter <atc@53hor.net> | 2021-04-09 18:50:55 -0400 |
commit | 201a37e8d3d0ef4c59b184c0707ec8ddd301a25a (patch) | |
tree | 1aae6c03bfb9f694adea81510dacf586311fcc12 /src/templates/mod.rs | |
parent | 881e4bf3c9141b4bebaefaf6385652ed46d9a9fe (diff) | |
download | twinh-201a37e8d3d0ef4c59b184c0707ec8ddd301a25a.tar.xz twinh-201a37e8d3d0ef4c59b184c0707ec8ddd301a25a.zip |
spruced up templates, some repo impl
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 +}); |