diff options
| author | WriterV2 <primary-v2@protonmail.com> | 2022-09-03 20:49:55 +0200 |
|---|---|---|
| committer | WriterV2 <primary-v2@protonmail.com> | 2022-09-03 20:49:55 +0200 |
| commit | 236e0d464f6472a36f7e1f5dc0b0f71b26b8ecc3 (patch) | |
| tree | 2219f27c22f4d3baeee778c827e168a86e7ae588 /src/main.rs | |
| parent | 9d2a896f0180e82d3728c5961c1312502100e69c (diff) | |
Add method to render overview page for work
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs index 4af487e..77f4fef 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,11 +14,9 @@ fn main() -> Result<()> { std::fs::write("docs/index.html", output)?; - let file = std::fs::File::open(std::path::PathBuf::from("stories.json"))?; - let stories = works::stories::Stories::new_from_file(file); - let context = stories?.create_tera_context(); - - let stories_html_output = tera.render("stories.html", &context?)?; - std::fs::write("docs/stories.html", stories_html_output)?; + let stories = works::stories::Stories::new_from_file(std::fs::File::open( + std::path::PathBuf::from("stories.json"), + )?); + stories?.render_overview_page(&tera, "stories")?; Ok(()) } |
