add more error logging
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -243,7 +243,7 @@ checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webTemplate"
|
name = "webTemplate"
|
||||||
version = "0.4.0"
|
version = "0.4.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"hashlink",
|
"hashlink",
|
||||||
"minijinja",
|
"minijinja",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "webTemplate"
|
name = "webTemplate"
|
||||||
version = "0.4.0"
|
version = "0.4.1"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|||||||
20
src/main.rs
20
src/main.rs
@@ -60,7 +60,12 @@ fn render_index(
|
|||||||
};
|
};
|
||||||
let dest_path: &Path = &cur_path.join(format!("{}.{}", friendly, extention));
|
let dest_path: &Path = &cur_path.join(format!("{}.{}", friendly, extention));
|
||||||
// render the content
|
// render the content
|
||||||
println!("INFO: render {}", dest_path.to_str().unwrap());
|
let dest_path_str = dest_path.to_str();
|
||||||
|
if dest_path_str == None {
|
||||||
|
println!("ERROR: dest path is None for page: {}", friendly);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
println!("INFO: render {}", dest_path_str.unwrap());
|
||||||
match site_index.render_page(index, &site_index.site, jinja_env) {
|
match site_index.render_page(index, &site_index.site, jinja_env) {
|
||||||
Some(content) => {
|
Some(content) => {
|
||||||
let _ = fs::write(dest_path, content);
|
let _ = fs::write(dest_path, content);
|
||||||
@@ -70,9 +75,16 @@ fn render_index(
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// file is an asset, no rendering done for assets
|
// file is an asset, no rendering done for assets
|
||||||
let dest_path: &Path = &cur_path.join(friendly);
|
let dest_path: &Path = &cur_path.join(friendly.clone());
|
||||||
println!("INFO: copy {}", dest_path.to_str().unwrap());
|
match dest_path.to_str() {
|
||||||
let _ = fs::copy(src, dest_path);
|
Some(dest_path_str) => {
|
||||||
|
println!("INFO: copy {}", dest_path_str);
|
||||||
|
let _ = fs::copy(src, dest_path);
|
||||||
|
}
|
||||||
|
None => {
|
||||||
|
println!("ERROR: dest path is None for asset: {}", friendly);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
|
|||||||
Reference in New Issue
Block a user