diff options
| author | WriterV2 <primary-v2@protonmail.com> | 2022-08-23 13:19:49 +0200 |
|---|---|---|
| committer | WriterV2 <primary-v2@protonmail.com> | 2022-08-23 13:19:49 +0200 |
| commit | 58f0228b4e769b39c330b0ed44deaa0fdaa669cf (patch) | |
| tree | 5583674b9c7d41886d9f4f096f4a91f9702ed714 /src | |
| parent | 816b4c15f5cbbc2e41da8a631ca8d5240bbb9881 (diff) | |
Restart with pure tera setup
Diffstat (limited to 'src')
| -rw-r--r-- | src/main.rs | 20 | ||||
| -rw-r--r-- | src/stories.rs | 0 |
2 files changed, 20 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..81c2c61 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,20 @@ +use tera::{Context, Tera}; + +fn main() { + let tera = match Tera::new("templates/**/*.html") { + Ok(t) => t, + Err(e) => { + println!("Parsing error(s): {}", e); + ::std::process::exit(1); + } + }; + + let context = Context::new(); + + let output = tera + .render("index.html", &context) + .expect("Failed to render index.html"); + + std::fs::write("docs/index.html", output) + .expect("Failed to write rendered output to index.html"); +} diff --git a/src/stories.rs b/src/stories.rs new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/stories.rs |
