diff --git a/todo/Cargo.toml b/todo/Cargo.toml index 1b9db82..03608c7 100644 --- a/todo/Cargo.toml +++ b/todo/Cargo.toml @@ -15,7 +15,7 @@ futures = "0.3.1" log = "0.4.3" serde = { version = "1.0.69", features = ["derive"] } serde_json = "1.0.22" -tera = "1.0" +tera = "1.5.0" [dependencies.diesel] features = ["postgres", "r2d2"] diff --git a/todo/src/main.rs b/todo/src/main.rs index 26d9484..f1f5ddc 100644 --- a/todo/src/main.rs +++ b/todo/src/main.rs @@ -33,7 +33,14 @@ async fn main() -> io::Result<()> { let app = move || { debug!("Constructing the App"); - let templates: Tera = Tera::new("templates/**/*").unwrap(); + let mut templates = match Tera::new("templates/**/*") { + Ok(t) => t, + Err(e) => { + println!("Parsing error(s): {}", e); + ::std::process::exit(1); + } + }; + templates.autoescape_on(vec!["tera"]); let session_store = CookieSession::signed(SESSION_SIGNING_KEY).secure(false); diff --git a/todo/templates/index.html.tera b/todo/templates/index.html.tera index 07ab321..64cbf85 100644 --- a/todo/templates/index.html.tera +++ b/todo/templates/index.html.tera @@ -52,7 +52,7 @@ {% else %}
{% endif %}