start
This commit is contained in:
parent
8afdd208c6
commit
8e82ec9523
23 changed files with 3345 additions and 0 deletions
20
froxy-templates/examples/friend.rs
Normal file
20
froxy-templates/examples/friend.rs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
use froxy_templates::friends::{self, Friend};
|
||||
|
||||
fn main() {
|
||||
let mut env = minijinja::Environment::new();
|
||||
friends::add_to_context(&mut env);
|
||||
let data = friends::render(
|
||||
&env,
|
||||
friends::FriendsData {
|
||||
friends: std::iter::from_fn(|| Some(Friend {
|
||||
name: "maiboyer".into(),
|
||||
image: "https://friends.42paris.fr/proxy/resize/512/03c61af252becbca11aac5ff49a2e61c/maiboyer.jpg".into(),
|
||||
position: Some("f1r1s1".into()),
|
||||
last_active: None,
|
||||
})).take(10).collect(),
|
||||
},
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
println!("{data}");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue