aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/pages/home.rs
blob: d76fc6e46a5de1bd82a7f91d710f186e566e4b78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::frontend::pages::node::NodePage;
use crate::{frontend::pages::HtmlTemplate, AppState};
use rocket::{get, State};

#[get("/")]
pub async fn page_home(state: &State<AppState>) -> HtmlTemplate<markup::DynRender> {
    HtmlTemplate(
        "Home".to_string(),
        markup::new! {
            h1 { "Welcome to Jellything" }
            @NodePage { node: state.library.root.clone() }
        },
    )
}