started writing some global vars
This commit is contained in:
1
TODO.txt
1
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 ")
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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?;
|
||||
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
MREOW
|
||||
{{ globals.version }}
|
||||
|
||||
Reference in New Issue
Block a user