Rust library to generate static websites
5
fork

Configure Feed

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

nit: misc logging changes

+13 -8
+9 -3
crates/framework/src/lib.rs
··· 100 100 fs::create_dir_all("dist").unwrap(); 101 101 fs::create_dir_all("dist/_assets").unwrap(); 102 102 103 - info!(target: "SKIP_FORMAT", "{}", " generating pages ".on_green().bold()); 103 + print_title("generating pages"); 104 104 let pages_start = SystemTime::now(); 105 105 106 106 let route_format_options = FormatElapsedTimeOptions { ··· 194 194 info!(target: "build", "{}", format!("Pages generated in {}", formatted_elasped_time).bold()); 195 195 196 196 let assets_start = SystemTime::now(); 197 - info!(target: "SKIP_FORMAT", "{}", " generating assets ".on_green().bold()); 197 + print_title("generating assets"); 198 198 199 199 build_pages_assets.iter().for_each(|asset| { 200 200 asset.process(); ··· 231 231 // Check if static directory exists 232 232 if PathBuf::from_str("./static").unwrap().exists() { 233 233 let assets_start = SystemTime::now(); 234 - info!(target: "SKIP_FORMAT", "{}", " copying assets ".on_green().bold()); 234 + print_title("copying assets"); 235 235 236 236 // Copy the static directory to the dist directory 237 237 copy_recursively("./static", "./dist", &mut build_metadata)?; ··· 243 243 244 244 let formatted_elasped_time = 245 245 format_elapsed_time(build_start.elapsed(), &section_format_options)?; 246 + info!(target: "SKIP_FORMAT", "{}", ""); 246 247 info!(target: "build", "{}", format!("Build completed in {}", formatted_elasped_time).bold()); 247 248 248 249 Ok(build_metadata) ··· 312 313 } 313 314 Ok(()) 314 315 } 316 + 317 + fn print_title(title: &str) { 318 + info!(target: "SKIP_FORMAT", "{}", ""); 319 + info!(target: "SKIP_FORMAT", "{}", format!(" {} ", title).on_green().bold()); 320 + }
+4 -5
crates/user-example/src/pages/index.rs
··· 14 14 15 15 let link_to_first_dynamic = DynamicExample::url(&DynamicExampleParams { page: 1 }); 16 16 17 - println!("Link to endpoint: {}", link_to_first_dynamic); 18 - 19 17 RenderResult::Html(html! { 20 - h1 { "Index" } 21 - img src=(image.path.to_string_lossy()) {} 22 - script src=(script.path.to_string_lossy()) {} 18 + h1 { "Index" } 19 + img src=(image.path.to_string_lossy()) {} 20 + script src=(script.path.to_string_lossy()) {} 21 + a href=(link_to_first_dynamic) { "Go to first dynamic page" } 23 22 }) 24 23 } 25 24 }