summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2023-02-04 14:06:12 +0100
committerWriterV2 <primary-v2@protonmail.com>2023-02-04 14:06:12 +0100
commit8f5034b8b7f31a8fb8864728942a6858467c6c87 (patch)
treeb302e2c437a289d15663bf8c7faa632652d8a00f /src/main.rs
parent63dbe5a65d7eb4a81d557d31f2983a512ba2b621 (diff)
Add works method to render single work pages
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
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(())
}