summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2022-09-04 18:12:55 +0200
committerWriterV2 <primary-v2@protonmail.com>2022-09-04 18:12:55 +0200
commit0ace78a01e59545953ef5be6ca6bcaa4a125a70b (patch)
treecba0424f103958a90b655f1ce33270cd5f15487d /src/main.rs
parent236e0d464f6472a36f7e1f5dc0b0f71b26b8ecc3 (diff)
Add error context + comments
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
1 files changed, 3 insertions, 2 deletions
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"),
)?);