+1
-1
Cargo.toml
+1
-1
Cargo.toml
+67
-5
posts/005-regenesis.md
+67
-5
posts/005-regenesis.md
···[theprimeagen](https://www.youtube.com/watch?v=rcZSOLAI1lM), and everpresent desire to rewrite everything in Rust,······
···[theprimeagen](https://www.youtube.com/watch?v=rcZSOLAI1lM), and everpresent desire to rewrite everything in Rust,···+Even scaling down from `axum` to `tiny_http`, it doesn't change the binary size, and because of the limited resources and location of the VPS,+Short of rewriting it all in [Yew](yew.rs) and loading the wasm as a SPA (which comes with it's own complexity) loading times would not improve.+//TODO: use some enum for pages, with derive as EnumString, so new pages can be added simply by adding a template.···+std::fs::write(format!("{output_path}/index.html"), handlers::index().as_bytes()).expect("Couldnt write index file");+std::fs::write(format!("{output_path}/about.html"), handlers::about().as_bytes()).expect("Couldnt write about file");+std::fs::write(format!("{output_path}/404.html"), handlers::not_found().as_bytes()).expect("Couldnt write 404 file");+let filename = entry.file_name().into_string().unwrap().split(".").collect::<Vec<_>>()[0].to_string();+fs::write(format!("{output_path}/blog/{filename}.html"), handlers::blog(filename).as_bytes()).expect("Couldnt write blog entry");+Built for release profile, binary is just 3.1M (majority of it is syntact), and produces a output folder with it's contents in a rather pleasant amount of time.
+1
-1
src/handlers.rs
+1
-1
src/handlers.rs
+5
-5
src/main.rs
+5
-5
src/main.rs
······-fs::write(format!("{output_path}/index.html"), handlers::index().as_bytes()).expect("Couldnt write index file");-fs::write(format!("{output_path}/about.html"), handlers::about().as_bytes()).expect("Couldnt write about file");-fs::write(format!("{output_path}/404.html"), handlers::not_found().as_bytes()).expect("Couldnt write 404 file");···let filename = entry.file_name().into_string().unwrap().split(".").collect::<Vec<_>>()[0].to_string();-fs::write(format!("{output_path}/blog/{filename}.html"), handlers::blog(filename).as_bytes()).expect("Couldnt write blog entry");
······+write(format!("{output_path}/index.html"), handlers::index().as_bytes()).expect("Couldnt write index file");+write(format!("{output_path}/about.html"), handlers::about().as_bytes()).expect("Couldnt write about file");+write(format!("{output_path}/404.html"), handlers::not_found().as_bytes()).expect("Couldnt write 404 file");···let filename = entry.file_name().into_string().unwrap().split(".").collect::<Vec<_>>()[0].to_string();+write(format!("{output_path}/blog/{filename}.html"), handlers::blog(filename).as_bytes()).expect("Couldnt write blog entry");