diff --git a/TODO.txt b/TODO.txt index 287cb53..65fb5ba 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1 +1,2 @@ Add global vars to the env context, then add vars from user defined config.toml to the env context... +Add asset store, with various path overrides in root config.toml i.e ("[assets.path_overrides] "/favicon.ico" = /icon.png ") diff --git a/src/loader.rs b/src/loader.rs index 2acbe94..75c1450 100644 --- a/src/loader.rs +++ b/src/loader.rs @@ -89,7 +89,7 @@ impl AppState<'_> { println!( "{:#?} has the same id as {:#?} !! not loading this page", entry.path(), - x.header.file_path.unwrap() + &x.header.file_path.clone().unwrap() ); error_out = true; break; diff --git a/src/main.rs b/src/main.rs index 28c94f5..40d9de1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -92,6 +92,7 @@ async fn listen( async fn init<'a>() -> Result> { let mut env = Environment::new(); let mut pages: Vec = Vec::new(); + env.add_global("globals", context! {version => "0.1.0"}); let mut state: AppState = AppState { pages, env }; state.load_from_fs().await?; diff --git a/template-serve/home/index.html b/template-serve/home/index.html index df6dd36..c82c107 100644 --- a/template-serve/home/index.html +++ b/template-serve/home/index.html @@ -1 +1,2 @@ MREOW +{{ globals.version }}