Rust library to generate static websites
5
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(assets): Also use a relative image path for cached assets

+9 -4
+5
.sampo/changesets/bold-guardian-lemminkainen.md
··· 1 + --- 2 + cargo/maudit: patch 3 + --- 4 + 5 + Fixes cached entries for processed assets showing a longer log than intended
+4 -4
crates/maudit/src/build.rs
··· 308 308 let start_process = Instant::now(); 309 309 let dest_path: &PathBuf = image.build_path(); 310 310 311 + let image_cwd_relative = diff_paths(image.path(), env::current_dir().unwrap()) 312 + .unwrap_or_else(|| image.path().to_path_buf()); 313 + 311 314 if let Some(image_options) = &image.options { 312 315 let final_filename = image.filename(); 313 316 ··· 317 320 if let Some(cached_path) = cached_path { 318 321 // Copy from cache instead of processing 319 322 if fs::copy(&cached_path, dest_path).is_ok() { 320 - info!(target: "assets", "{} -> {} (from cache) {}", image.path().to_string_lossy(), dest_path.to_string_lossy().dimmed(), format_elapsed_time(start_process.elapsed(), &route_format_options).dimmed()); 323 + info!(target: "assets", "{} -> {} (from cache) {}", image_cwd_relative.to_string_lossy(), dest_path.to_string_lossy().dimmed(), format_elapsed_time(start_process.elapsed(), &route_format_options).dimmed()); 321 324 return; 322 325 } 323 326 } ··· 345 348 ) 346 349 }); 347 350 } 348 - // Make path relative to cwd for logging 349 - let image_cwd_relative = diff_paths(image.path(), env::current_dir().unwrap()) 350 - .unwrap_or_else(|| image.path().to_path_buf()); 351 351 info!(target: "assets", "{} -> {} {}", image_cwd_relative.to_string_lossy(), dest_path.to_string_lossy().dimmed(), format_elapsed_time(start_process.elapsed(), &route_format_options).dimmed()); 352 352 }); 353 353