little-hesinde/rusty-library/src/templates.rs

17 lines
549 B
Rust
Raw Normal View History

2024-05-02 16:10:29 +00:00
use once_cell::sync::Lazy;
use tera::Tera;
pub static TEMPLATES: Lazy<Tera> = Lazy::new(|| {
let mut tera = Tera::default();
tera.add_raw_templates(vec![
("base", include_str!("../templates/base.html")),
2024-05-06 08:40:34 +00:00
("book_card", include_str!("../templates/book_card.html")),
2024-05-06 11:51:49 +00:00
("authors", include_str!("../templates/authors.html")),
2024-05-06 12:42:14 +00:00
("book_list", include_str!("../templates/book_list.html")),
2024-05-06 12:17:25 +00:00
("books", include_str!("../templates/books.html")),
2024-05-02 16:10:29 +00:00
])
.expect("failed to parse tera templates");
tera
});