From 18853a2baf20017e926e4bb465e3c02bb5a7af97 Mon Sep 17 00:00:00 2001 From: WriterV2 Date: Sat, 3 Sep 2022 18:45:45 +0200 Subject: Universalize method to create context from works and pass entire works object --- src/main.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 3985b06..7f658ef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -32,4 +32,11 @@ fn main() { let context = stories.create_tera_context(); println!("Context: {:?}\n", context); + + let stories_html_output = tera + .render("stories.html", &context) + .expect("Failed to render stories.html"); + + std::fs::write("docs/stories.html", stories_html_output) + .expect("Failed to write rendered output to stories.html"); } -- cgit v1.2.3