wip
This commit is contained in:
1
src/tools/mod.rs
Normal file
1
src/tools/mod.rs
Normal file
@@ -0,0 +1 @@
|
||||
pub mod tera;
|
||||
12
src/tools/tera.rs
Normal file
12
src/tools/tera.rs
Normal file
@@ -0,0 +1,12 @@
|
||||
use std::collections::HashMap;
|
||||
|
||||
use rocket_dyn_templates::tera::{Value, Error};
|
||||
|
||||
|
||||
pub fn static_filter(
|
||||
value: &Value,
|
||||
args: &HashMap<String, rocket_dyn_templates::tera::Value>
|
||||
) -> Result<Value, Error> {
|
||||
let host = args.get("static_host");
|
||||
return Ok(rocket_dyn_templates::tera::Value::String(format!("{}/{}", host.unwrap().as_str().unwrap(), value.as_str().unwrap()))); // TODO: fix-me here!
|
||||
}
|
||||
Reference in New Issue
Block a user