aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/ui
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2023-01-22 18:06:53 +0100
committermetamuffin <metamuffin@disroot.org>2023-01-22 18:06:53 +0100
commit34cb7d576b1aec8b53cf1f6398480cf8d3fa24c7 (patch)
treeb752d8587b984d36def9962118b0afc2f2953066 /server/src/routes/ui
parenta8402e7f17e978b839a605d4715ca51b4a76f1f3 (diff)
downloadjellything-34cb7d576b1aec8b53cf1f6398480cf8d3fa24c7.tar
jellything-34cb7d576b1aec8b53cf1f6398480cf8d3fa24c7.tar.bz2
jellything-34cb7d576b1aec8b53cf1f6398480cf8d3fa24c7.tar.zst
front page stuff
Diffstat (limited to 'server/src/routes/ui')
-rw-r--r--server/src/routes/ui/home.rs13
1 files changed, 8 insertions, 5 deletions
diff --git a/server/src/routes/ui/home.rs b/server/src/routes/ui/home.rs
index b9e9289..165fbb7 100644
--- a/server/src/routes/ui/home.rs
+++ b/server/src/routes/ui/home.rs
@@ -1,12 +1,14 @@
use super::account::session::Session;
use super::layout::LayoutPage;
+use crate::routes::ui::error::MyResult;
use crate::routes::ui::layout::DynLayoutPage;
use crate::CONF;
use crate::{library::Library, routes::ui::node::NodePage};
use rocket::{get, State};
+use tokio::fs::read_to_string;
#[get("/")]
-pub async fn r_home(_sess: Session, library: &State<Library>) -> DynLayoutPage {
+pub fn r_home(_sess: Session, library: &State<Library>) -> DynLayoutPage {
LayoutPage {
title: "Home".to_string(),
content: markup::new! {
@@ -17,11 +19,12 @@ pub async fn r_home(_sess: Session, library: &State<Library>) -> DynLayoutPage {
}
#[get("/", rank = 2)]
-pub async fn r_home_unpriv() -> DynLayoutPage<'static> {
- LayoutPage {
+pub async fn r_home_unpriv() -> MyResult<DynLayoutPage<'static>> {
+ let front = read_to_string(CONF.asset_dir.join("front.htm")).await?;
+ Ok(LayoutPage {
title: "Home".to_string(),
content: markup::new! {
- h1 { @CONF.brand }
+ @markup::raw(&front)
},
- }
+ })
}