diff options
| author | WriterV2 <primary-v2@protonmail.com> | 2023-02-04 14:06:12 +0100 |
|---|---|---|
| committer | WriterV2 <primary-v2@protonmail.com> | 2023-02-04 14:06:12 +0100 |
| commit | 8f5034b8b7f31a8fb8864728942a6858467c6c87 (patch) | |
| tree | b302e2c437a289d15663bf8c7faa632652d8a00f /src/main.rs | |
| parent | 63dbe5a65d7eb4a81d557d31f2983a512ba2b621 (diff) | |
Add works method to render single work pages
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main.rs b/src/main.rs index 942b621..871c57e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -15,9 +15,11 @@ fn main() -> Result<()> { 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"), + let stories = std::rc::Rc::new(works::stories::Stories::new_from_file( + std::fs::File::open(std::path::PathBuf::from("stories.json"))?, )?); - stories?.render_overview_page(&tera, "stories")?; + std::rc::Rc::clone(&stories).render_overview_page(&tera, "stories")?; + std::rc::Rc::clone(&stories).render_single_pages(&tera, "story")?; + Ok(()) } |
