aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/ui/home.rs
blob: 6e4684c017efe4b255a6e0ee863669af0e334bf0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::account::session::Session;
use super::layout::LayoutPage;
use crate::routes::ui::layout::DynLayoutPage;
use crate::CONF;
use crate::{library::Library, routes::ui::node::NodePage};
use rocket::{get, State};

#[get("/")]
pub async fn r_home(_sess: Session, library: &State<Library>) -> DynLayoutPage {
    LayoutPage {
        title: "Home".to_string(),
        content: markup::new! {
            p { "Welcome to " @CONF.brand  }
            @NodePage { node: library.root.clone() }
        },
    }
}