summaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorWriterV2 <primary-v2@protonmail.com>2024-08-04 10:07:08 +0200
committerWriterV2 <primary-v2@protonmail.com>2024-08-04 10:07:08 +0200
commitf982a5621bfed646ce71fcf7aeeca71ef4ae55c1 (patch)
tree4811e7dbd105b0a17da8725d5f7a9a5536eb5fbc /src/main.rs
parent19c2c05c6f5220f4feedad99a38e0fb4dc57b957 (diff)
Purge
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/main.rs b/src/main.rs
index 8dddff7..37f1399 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,31 +1,5 @@
-use std::fs::write;
-
-use anyhow::{Context, Ok, Result};
-use tera::Tera;
-
-use self::works::stories::Stories;
-use self::works::Works;
-
-mod works;
-
-const STORY: (&str, &str) = ("stories", "story");
+use anyhow::Result;
fn main() -> Result<()> {
- // new tera instance
- let tera = Tera::new("templates/**/*.html").context("Failed to create new Tera instance")?;
-
- // render index.html file
- let output = tera
- .render("index.html", &tera::Context::new())
- .context("Failed to render index.html")?;
- write("docs/index.html", output).context("Failed to write index.html")?;
-
- // render pages for stories
- Stories::new_from_file(STORY.0)?
- .render_overview_page(&tera, STORY.0)
- .context("Failed to render overview page for stories")?
- .render_single_pages(&tera, STORY.1)
- .context("Failed to render single pages for stories")?;
-
Ok(())
}