started writing some global vars

This commit is contained in:
2026-01-16 16:25:38 +00:00
parent 23a5d5596e
commit 2f2d3073d8
4 changed files with 4 additions and 1 deletions

View File

@@ -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 ")

View File

@@ -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;

View File

@@ -92,6 +92,7 @@ async fn listen(
async fn init<'a>() -> Result<AppState<'a>> {
let mut env = Environment::new();
let mut pages: Vec<Page> = Vec::new();
env.add_global("globals", context! {version => "0.1.0"});
let mut state: AppState = AppState { pages, env };
state.load_from_fs().await?;

View File

@@ -1 +1,2 @@
MREOW
{{ globals.version }}