chore(renamed): removed froxy prefix on folders

This commit is contained in:
Maieul BOYER 2026-02-08 18:13:20 +01:00
parent e57bb34a35
commit 6960959794
Signed by: maix
SSH key fingerprint: SHA256:iqCzqFFF5KjRixmDExqbAltCIj9ndlBWIGJf3t9Ln9g
29 changed files with 32 additions and 12 deletions

View 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::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(),
},
)
.unwrap();
println!("{data}");
}

114
templates/examples/index.rs Normal file
View file

@ -0,0 +1,114 @@
use std::collections::HashMap;
use froxy_templates::index::{self, ClusterData, IndexData, LocationData, MapPos, PcIssue};
use smol_str::SmolStr;
fn main() {
let mut env = minijinja::Environment::new();
index::add_to_context(&mut env);
let data = index::render(
&env,
IndexData {
clusters: HashMap::from([(
SmolStr::new_static("F1"),
ClusterData {
users: 80,
max_pc: 100,
dead_pc: 1,
silent: false,
piscine: true,
issues: [
(SmolStr::new_static("F1r1s1"), PcIssue::Dead),
(SmolStr::new_static("F1r2s1"), PcIssue::Attention),
]
.into_iter()
.collect(),
map: index::Map {
rows: [
index::MapRow {
range: SmolStr::new_static("R1"),
col: [
MapPos::Empty,
MapPos::Flex,
MapPos::Wall,
MapPos::Door,
MapPos::Empty,
]
.to_vec(),
},
index::MapRow {
range: SmolStr::new_static("R2"),
col: [
MapPos::Empty,
MapPos::Flex,
MapPos::Pc(SmolStr::new_static("F1r1s1")),
MapPos::Pc(SmolStr::new_static("F1r2s1")),
MapPos::Pc(SmolStr::new_static("F1r3s1")),
MapPos::Pc(SmolStr::new_static("F1r4s1")),
MapPos::Pc(SmolStr::new_static("F1r5s1")),
MapPos::Empty,
]
.to_vec(),
},
index::MapRow {
range: SmolStr::new_static("R3"),
col: [
MapPos::Empty,
MapPos::Flex,
MapPos::Wall,
MapPos::Door,
MapPos::Empty,
]
.to_vec(),
},
]
.to_vec(),
},
},
),
(
SmolStr::new_static("F3"),
ClusterData {
users: 80,
max_pc: 400,
dead_pc: 1,
silent: false,
piscine: false,
issues: Default::default(),
map: index::Map {
rows: Vec::new(),
},
},
),
(
SmolStr::new_static("F2"),
ClusterData {
users: 180,
max_pc: 200,
dead_pc: 1,
silent: true,
piscine: true,
issues: Default::default(),
map: index::Map {
rows: Vec::new(),
},
},
)]),
locations: [(SmolStr::new_static("F1r5s1"), LocationData {
login: "maiboyer".into(),
image: "https://friends.42paris.fr/proxy/resize/512/03c61af252becbca11aac5ff49a2e61c/maiboyer.jpg".into(),
me: false,
friend: false,
close_friend: false,
pooled: false,
})]
.into_iter()
.collect(),
current_cluster: SmolStr::new_static("F1"),
},
)
.unwrap();
println!("{data}");
}

View file

@ -0,0 +1,27 @@
use froxy_templates::profile::{self};
use smol_str::SmolStr;
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}");
}