diff options
| author | WriterV2 <primary-v2@protonmail.com> | 2026-04-03 15:50:13 +0200 |
|---|---|---|
| committer | WriterV2 <primary-v2@protonmail.com> | 2026-04-03 15:50:13 +0200 |
| commit | 6f9b52954da265066edfca19464d1ef56e29cb53 (patch) | |
| tree | b8f1caf9198df64abcd686e64b1c260d87a38241 /src/main.rs | |
| parent | c40fb1213ca852df4ec138a84275e277e7f7614b (diff) | |
Add html minifier + refactor file writing
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs index 02aac19..1108c23 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ struct Data { impl page::Page for Vec<Story> { fn page_title() -> String { - String::from("Storys") + String::from("Stories") } fn render_content(self) -> Markup { @@ -44,8 +44,6 @@ fn main() -> Result<()> { let data_file_content = std::fs::read_to_string("data.toml").with_context(|| "Failed to read data.toml")?; let data: Data = toml::from_str(&data_file_content)?; - let stories_html = data.stories.render_page(); - std::fs::write("dist/stories.html", stories_html.into_string()) - .with_context(|| "Failed to write dist/stories.html")?; + data.stories.write_page()?; Ok(()) } |
