diff options
| author | WriterV2 <primary-v2@protonmail.com> | 2022-08-23 17:10:09 +0200 |
|---|---|---|
| committer | WriterV2 <primary-v2@protonmail.com> | 2022-08-23 17:10:09 +0200 |
| commit | 5d6943eca8f60e5a7b1422f9c9be2ca93b52104f (patch) | |
| tree | 2ce7b3ef1f93bdc2feb948795a2780e6401ddd73 /src/main.rs | |
| parent | 58f0228b4e769b39c330b0ed44deaa0fdaa669cf (diff) | |
Add Works trait & implement it for Stories
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs index 81c2c61..b3e907d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,9 @@ use tera::{Context, Tera}; +use self::works::Work; + +mod works; + fn main() { let tera = match Tera::new("templates/**/*.html") { Ok(t) => t, @@ -17,4 +21,12 @@ fn main() { std::fs::write("docs/index.html", output) .expect("Failed to write rendered output to index.html"); + + let mut file = match std::fs::File::open(std::path::PathBuf::from("stories.json")) { + Ok(file) => file, + Err(err) => panic!("Trying to open stories.json in readmode - {:?}", err), + }; + + let stories = works::stories::Stories::new_from_file(file); + println!("Stories: {:?}", stories); } |
