use std::path::{Path, PathBuf}; use chrono::{NaiveDate, NaiveDateTime}; use tavern::{Adventurer, Database, Tale, Tavern}; fn generate_tavern() -> Tavern { let author: Adventurer = Adventurer { name: String::from("Jason Smith"), handle: String::from("myrddin"), profile: String::from("https://cybermages.tech/about/myrddin"), image: String::from("https://cybermages.tech/about/myrddin/pic"), blurb: String::from("I love code!") }; let tale: Tale = Tale { title: String::from("Test post"), slug: String::from("test_post"), author: author.handle.clone(), summary: String::from("The Moon is made of cheese!"), tags: vec![String::from("Space"), String::from("Cheese")], publish_date: NaiveDate::from_ymd_opt(2025, 12, 25).unwrap().and_hms_opt(13, 10, 41).unwrap(), content: PathBuf::from("posts/test_post.md") }; // Create a dummy posts directory and file for this example to work if !Path::new("posts").exists() { std::fs::create_dir("posts").unwrap(); } std::fs::write("posts/the-rustacean.md", "# Hello, Rust!\n\nThis is a **test** post.").unwrap(); Tavern { title: String::from("Runes & Ramblings"), description: String::from("Join software engineer Jason Smith on his Rust programming journey. Explore program design, tech stacks, and more on this blog from CybeMages, LLC."), tales: vec![tale], authors: vec![author] } } fn read_from_file
(config_file: P) -> Tavern
where P: AsRef