diff --git a/src/main.rs b/src/main.rs index 726e98d..4388076 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use crate::config::{read_config, Route, RouteGroup}; use actix_web::{middleware::Logger, App, HttpServer}; use clap::{crate_authors, crate_version, load_yaml, App as ClapApp}; use error::BunBunError; -use handlebars::Handlebars; +use handlebars::{Output, Handlebars, HelperResult, RenderContext, Context, Helper}; use hotwatch::{Event, Hotwatch}; use log::{debug, info, trace, warn}; use std::cmp::min; @@ -117,6 +117,8 @@ fn cache_routes(groups: &[RouteGroup]) -> HashMap { /// templates at runtime. fn compile_templates() -> Handlebars { let mut handlebars = Handlebars::new(); + handlebars.set_strict_mode(true); + handlebars.register_partial("bunbun_version", env!("CARGO_PKG_VERSION")).unwrap(); macro_rules! register_template { [ $( $template:expr ),* ] => { $( diff --git a/src/templates/index.hbs b/src/templates/index.hbs index 3130724..db1aca0 100644 --- a/src/templates/index.hbs +++ b/src/templates/index.hbs @@ -16,6 +16,10 @@ h1, p { margin: 0; } main { display: flex; } a { color: white; } + footer { + margin-top: 1rem; + color: #444; + }

To view a full list of commands, check out the command list.

+ diff --git a/src/templates/list.hbs b/src/templates/list.hbs index 5fc7268..0e9e70d 100644 --- a/src/templates/list.hbs +++ b/src/templates/list.hbs @@ -21,6 +21,10 @@ td, th { padding: 0 0.5rem; } .shortcut { text-align: right; } .target { text-align: left; width: 100%; } + footer { + margin-top: 1rem; + color: #444; + } @@ -39,4 +43,7 @@ {{/each}} +