From ee0d056d189567be3c1a186613f390f3f5b4dcd3 Mon Sep 17 00:00:00 2001 From: Paul van Tilburg Date: Tue, 2 Jan 2018 12:48:58 +0100 Subject: [PATCH] Add the app version to the home index template context --- src/handlers/home.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/handlers/home.rs b/src/handlers/home.rs index fb9f784..442b4f7 100644 --- a/src/handlers/home.rs +++ b/src/handlers/home.rs @@ -5,6 +5,7 @@ use super::super::ListStore; #[derive(Serialize)] struct IndexTemplateContext<'a> { + app_version: &'a str, lists: Vec> } @@ -18,7 +19,10 @@ fn index(lists: State) -> Template { list_kv.insert("name", list.name.as_ref()); list_kvs.push(list_kv); } - let context = IndexTemplateContext { lists: list_kvs }; + let context = IndexTemplateContext { + app_version: env!("CARGO_PKG_VERSION"), + lists: list_kvs + }; Template::render("index", &context) }