From 0ace78a01e59545953ef5be6ca6bcaa4a125a70b Mon Sep 17 00:00:00 2001 From: WriterV2 Date: Sun, 4 Sep 2022 18:12:55 +0200 Subject: Add error context + comments --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 77f4fef..942b621 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,14 +6,15 @@ use crate::works::Works; mod works; fn main() -> Result<()> { + // new tera instance let tera = Tera::new("templates/**/*.html")?; + // render index.html file let context = Context::new(); - let output = tera.render("index.html", &context)?; - std::fs::write("docs/index.html", output)?; + // render stories.html file let stories = works::stories::Stories::new_from_file(std::fs::File::open( std::path::PathBuf::from("stories.json"), )?); -- cgit v1.2.3