feat(template): profile template works great :D

This commit is contained in:
Maieul BOYER 2026-02-08 14:32:18 +01:00
parent 436331bc72
commit 5340afbf94
Signed by: maix
SSH key fingerprint: SHA256:iqCzqFFF5KjRixmDExqbAltCIj9ndlBWIGJf3t9Ln9g
3 changed files with 63 additions and 29 deletions

View file

@ -0,0 +1,38 @@
use froxy_templates::profile::{self};
use smol_str::SmolStr;
/*
{
friends: std::array::from_fn::<_, 10, _>(|i| Friend {
name: "maiboyer".into(),
image: "https://friends.42paris.fr/proxy/resize/512/03c61af252becbca11aac5ff49a2e61c/maiboyer.jpg".into(),
position: (i < 5).then_some("f1r1s1".into()),
last_active: (i > 6).then_some("Last thuesday".into()),
}).to_vec(),
}
*/
fn main() {
let mut env = minijinja::Environment::new();
profile::add_to_context(&mut env);
let data = profile::render(
&env,
profile::ProfileData {
user: profile::ProfileUser {
position: Some(SmolStr::new_static("f1r1s1")),
last_active: None,
image: "https://friends.42paris.fr/proxy/resize/512/03c61af252becbca11aac5ff49a2e61c/maiboyer.jpg".into(),
name: SmolStr::new_static("maiboyer"),
pool: None, //Some(SmolStr::new_static("August 2025")),
is_friend: false,
github: Some("https://github.com/Maix0".to_string()),
website: None, //Some("https://maix.me".to_string()),
discord: None,// Some("maix".to_string()),
recit: Some("Yes".to_string()),
},
},
)
.unwrap();
println!("{data}");
}