1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
/*
This file is part of jellything (https://codeberg.org/metamuffin/jellything)
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2026 metamuffin <metamuffin.org>
*/
use crate::{
RenderInfo,
components::node_card::{NodeCard, NodeCardHightlight},
page,
};
use jellycommon::Nku;
use jellyui_locale::tr;
pub enum HomeRow<'a> {
Inline(Vec<Nku<'a>>),
Highlight(Nku<'a>),
}
page!(Home<'_>, |x| tr(x.ri.lang, "home"));
markup::define! {
Home<'a>(ri: &'a RenderInfo<'a>, rows: &'a [(&'a str, HomeRow<'a>)]) {
@for (title, row) in *rows {
h2 { @tr(ri.lang, title) }
@match row {
HomeRow::Inline(nkus) => {
ul.nl.inline { @for nku in nkus {
li { @NodeCard { ri, nku } }
}}
}
HomeRow::Highlight(nku) => {
@NodeCardHightlight { ri, nku }
}
}
}
}
}
|