add part function
CI/CD Pipeline / deploy-main (push) Has been skipped

This commit is contained in:
2024-02-20 13:03:06 +01:00
parent 4766c00c9b
commit 4a6c986a66
8 changed files with 102 additions and 110 deletions
+4
View File
@@ -1,6 +1,9 @@
use std::{fs, path::Path};
use part::Parts;
mod law;
mod part;
fn main() {
fs::create_dir_all("./output").unwrap();
@@ -15,6 +18,7 @@ fn main() {
fn create_index(content: &str) {
let mut index = fs::read_to_string("templates/index.html").unwrap();
index = index.replace("{{content}}", content);
let index = Parts::new().perform(index);
fs::write("output/index.html", &index).expect("Unable to write file");
}