summaryrefslogtreecommitdiff
path: root/src/main.rs
blob: 81c2c6163eee441a37ba6c538e03100bffe26bf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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");
}