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

17 lines
549 B
Rust

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")),
("book_card", include_str!("../templates/book_card.html")),
("authors", include_str!("../templates/authors.html")),
("book_list", include_str!("../templates/book_list.html")),
("books", include_str!("../templates/books.html")),
])
.expect("failed to parse tera templates");
tera
});