From 1608b7a33732bcb28e847a268fc0a7c493712fff Mon Sep 17 00:00:00 2001 From: JMARyA Date: Wed, 18 Sep 2024 11:15:30 +0200 Subject: [PATCH] fix --- src/config.rs | 2 +- src/main.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/config.rs b/src/config.rs index 17939b4..54b5177 100644 --- a/src/config.rs +++ b/src/config.rs @@ -49,7 +49,7 @@ impl Project { maud::html!( div class="card" id=(card_id) { @if let Some(icon) = &self.icon { - img src=(format!("/static/icons/{}", icon)) style="float: left; width: 200px; height: 200px;"; + img src=(format!("/static/{}", icon)) style="float: left; width: 200px; height: 200px;margin-right: 80px;"; } h3 { (self.name) }; p { (self.description) }; diff --git a/src/main.rs b/src/main.rs index 9db7966..2574543 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,9 +8,9 @@ use rocket::{get, launch, routes, State}; mod config; mod site; -#[get("/icon/")] +#[get("/static/")] async fn icon_res(file: &str) -> Option { - let path = Path::new("static/icons/").join(file); + let path = Path::new("static").join(file); NamedFile::open(path).await.ok() } @@ -19,6 +19,8 @@ pub fn main_page(c: &State) -> RawHtml { RawHtml(site::gen_site(c)) } +// todo : fav icon + #[launch] async fn rocket() -> _ { let conf_path: String = std::env::args()