/* 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) 2023 metamuffin */ use super::{account::session::Session, layout::LayoutPage}; use crate::{ database::Database, routes::ui::{error::MyResult, layout::DynLayoutPage}, CONF, }; use rocket::{get, State}; use tokio::fs::read_to_string; #[get("/")] pub fn r_home(_sess: Session, _db: &State) -> DynLayoutPage { LayoutPage { title: "Home".to_string(), content: markup::new! { p { "Welcome to " @CONF.brand } // @NodePage { node: &db } }, ..Default::default() } } #[get("/", rank = 2)] pub async fn r_home_unpriv() -> MyResult> { let front = read_to_string(CONF.asset_path.join("front.htm")).await?; Ok(LayoutPage { title: "Home".to_string(), content: markup::new! { @markup::raw(&front) }, ..Default::default() }) }