mirror of
https://github.com/Brandon-Rozek/website-toots.git
synced 2024-11-09 10:40:35 -05:00
Changed output
This commit is contained in:
parent
53060c3c08
commit
4f73f9173b
1 changed files with 5 additions and 2 deletions
|
@ -5,14 +5,14 @@ use tera::Tera;
|
||||||
use tera::Context;
|
use tera::Context;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
println!("Hello, world!");
|
|
||||||
|
|
||||||
let mut tera = Tera::default();
|
let mut tera = Tera::default();
|
||||||
tera.add_template_file("src/toot.md", None).unwrap();
|
tera.add_template_file("src/toot.md", None).unwrap();
|
||||||
|
|
||||||
let data_dir = std::fs::read_dir("../.data")
|
let data_dir = std::fs::read_dir("../.data")
|
||||||
.expect("Failed to open data directory");
|
.expect("Failed to open data directory");
|
||||||
|
|
||||||
|
let mut count = 0;
|
||||||
|
|
||||||
for entry in data_dir {
|
for entry in data_dir {
|
||||||
|
|
||||||
let opath = entry.ok().map(|v| v.path());
|
let opath = entry.ok().map(|v| v.path());
|
||||||
|
@ -59,6 +59,9 @@ fn main() {
|
||||||
file.write_all(output.as_bytes())
|
file.write_all(output.as_bytes())
|
||||||
.expect("Failed to write to markdown file");
|
.expect("Failed to write to markdown file");
|
||||||
|
|
||||||
|
count += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
println!("Successfully generated {} Markdown Files", count);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue