diff options
| author | WriterV2 <primary-v2@protonmail.com> | 2023-06-03 15:10:27 +0200 |
|---|---|---|
| committer | WriterV2 <primary-v2@protonmail.com> | 2023-06-03 15:10:27 +0200 |
| commit | ac447d7558d207256596dd47141cfe3d8f61d349 (patch) | |
| tree | effc11bdecb2e6075fe2f74b1f2c32be11501185 /src/main.rs | |
| parent | c8393e29b93a0d36b35134cfa12b9e4cbd41a62a (diff) | |
Add constants for story file names
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 8fbb920..8dddff7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,8 @@ use self::works::Works; mod works; +const STORY: (&str, &str) = ("stories", "story"); + fn main() -> Result<()> { // new tera instance let tera = Tera::new("templates/**/*.html").context("Failed to create new Tera instance")?; @@ -19,10 +21,10 @@ fn main() -> Result<()> { write("docs/index.html", output).context("Failed to write index.html")?; // render pages for stories - Stories::new_from_file("stories")? - .render_overview_page(&tera, "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") + .render_single_pages(&tera, STORY.1) .context("Failed to render single pages for stories")?; Ok(()) |
