diff --git a/src/lib.rs b/src/lib.rs index ac5a465..fd1294c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -65,6 +65,8 @@ use std::str::FromStr; pub struct DbConn(PgConnection); pub type ConcreteConnection = PgConnection; +pub const ZAUTH_VERSION: &str = env!("CARGO_PKG_VERSION"); + #[get("/favicon.ico")] pub fn favicon() -> &'static str { "" diff --git a/src/views/template.rs b/src/views/template.rs index 741d742..eedd625 100644 --- a/src/views/template.rs +++ b/src/views/template.rs @@ -5,8 +5,13 @@ macro_rules! template { use askama::Template; #[derive(Template, Debug)] #[template(path = $template_name)] - struct TemplateStruct {} - TemplateStruct{} + struct TemplateStruct { + #[allow(dead_code)] + zauth_version: &'static str + } + TemplateStruct { + zauth_version: crate::ZAUTH_VERSION, + } } }; @@ -16,11 +21,14 @@ macro_rules! template { #[derive(Template, Debug)] #[template(path = $template_name)] struct TemplateStruct { + #[allow(dead_code)] + zauth_version: &'static str, $( $name: $type, )+ } TemplateStruct { + zauth_version: crate::ZAUTH_VERSION, $( $name: $value, )+ diff --git a/templates/layout.html b/templates/layout.html index 859e841..fdd0120 100644 --- a/templates/layout.html +++ b/templates/layout.html @@ -32,7 +32,7 @@
- Zauth by Zeus WPI + Zauth v{{ zauth_version }} by Zeus WPI