add logging in load_templates
This commit is contained in:
parent
d75da67690
commit
ea4217f197
@ -11,13 +11,12 @@ pub fn load_templates() -> Result<tera::Tera, Box<dyn std::error::Error>> {
|
||||
.map(|s| s.to_string())
|
||||
.collect();
|
||||
for entry in TEMPLATES_DIR.find("**/*.html")? {
|
||||
tracing::info!(path=entry.path().to_str().unwrap_or_default(), "found embeded template");
|
||||
if let Some(file) = entry.as_file() {
|
||||
let path = file.path();
|
||||
let path = path.to_string_lossy().to_string();
|
||||
if template_names.contains(&path) {
|
||||
continue;
|
||||
}
|
||||
if let Some(content) = file.contents_utf8() {
|
||||
tracing::info!(path=entry.path().to_str().unwrap_or_default(), "added embeded template");
|
||||
templates.add_raw_template(&path, content)?;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user