Migrate what bit of the yapper.py script there was to rust.

This commit is contained in:
Olivia Brooks
2025-10-12 22:34:54 -04:00
parent bda1b138df
commit d9dcf43be8
6 changed files with 719 additions and 0 deletions

37
src/main.rs Normal file
View File

@@ -0,0 +1,37 @@
mod blog;
mod error;
mod og;
use clap::Parser;
use std::path::PathBuf;
use crate::blog::Meta;
#[derive(Debug, Parser)]
#[clap(author, version, about)]
struct Args {
/// Path to blog root.
#[arg(
short = 'i',
long,
value_hint = clap::ValueHint::DirPath,
default_value = format!("../test_tree/")
)]
blog_path: PathBuf,
#[arg(short, long, value_hint = clap::ValueHint::DirPath)]
fallback_meta: PathBuf,
#[arg(short, long, value_hint = clap::ValueHint::DirPath)]
single_meta: PathBuf,
}
fn main() {
let config = Args::parse();
blog::FALLBACK_META_PATH.get_or_init(|| config.fallback_meta);
let _meta = Meta::try_from(config.single_meta).expect("Failed to deserialize single_meta file");
println!("Loaded FallbackMeta");
}