2 Commits

Author SHA1 Message Date
aa18b587dd bump version number 2025-07-23 17:04:01 +02:00
6de1607e2d add arguments 2025-07-23 16:51:10 +02:00
3 changed files with 23 additions and 6 deletions

2
Cargo.lock generated
View File

@@ -243,7 +243,7 @@ checksum = "4a1a07cc7db3810833284e8d372ccdc6da29741639ecc70c9ec107df0fa6154c"
[[package]]
name = "webTemplate"
version = "0.2.0"
version = "0.3.0"
dependencies = [
"hashlink",
"minijinja",

View File

@@ -1,6 +1,6 @@
[package]
name = "webTemplate"
version = "0.2.0"
version = "0.3.0"
edition = "2024"
[dependencies]

View File

@@ -1,5 +1,4 @@
use std::{path::Path};
use std::fs;
use std::{path::Path, fs, env};
use minijinja::Environment;
mod render;
@@ -48,9 +47,27 @@ fn render_index(out_path: &Path, index: &IndexItem, cur_path: &Path, site_index:
}
fn main() {
let mut src_path_str: String = SRC_PATH.to_string();
let mut out_path_str: String = OUT_PATH.to_string();
let src_path = Path::new(SRC_PATH);
let out_path = Path::new(OUT_PATH);
let mut i: u8 = 0;
for arg in env::args() {
match i {
0 => {}
1 => {
src_path_str = arg;
}
2 => {
out_path_str = arg;
}
_ => {}
}
i += 1;
}
let src_path = Path::new(&src_path_str);
let out_path = Path::new(&out_path_str);
let index = Renderer::index(src_path).unwrap();