Add html!{} and Tera templates for PageTop

This commit is contained in:
Manuel Cillero 2024-11-17 08:06:46 +01:00
parent 046d5605e9
commit bf150d206f
30 changed files with 2756 additions and 416 deletions

View file

@ -0,0 +1,23 @@
use pagetop_aliner::{TEMPLATE_BASE_DIR, TEMPLATE_GLOB};
use tera::Tera;
/// Test to ensure Tera can initialize templates from the file system in debug mode.
#[test]
fn aliner_initialization_in_debug_mode() {
let tera = Tera::new(TEMPLATE_GLOB);
assert!(tera.is_ok(), "Failed to initialize Tera in debug mode");
}
/// Test to ensure templates embedded in the binary can be properly loaded in release mode.
#[test]
fn aliner_initialization_in_release_mode() {
for file in TEMPLATE_BASE_DIR.files() {
let content = file.contents_utf8();
assert!(
content.is_some(),
"File {:?} contains non-UTF-8 content",
file.path()
);
}
}