diff options
author | metamuffin <metamuffin@disroot.org> | 2023-07-12 21:16:21 +0200 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-07-12 21:16:21 +0200 |
commit | b01995c9dfa957acf8c5a06c323f4b548dca3bca (patch) | |
tree | 4608e36529b106e129811d61fcf51051409f26f0 | |
parent | 7659b565a66a6036dce96983424e3ad88e20251f (diff) | |
download | metamuffin-website-b01995c9dfa957acf8c5a06c323f4b548dca3bca.tar metamuffin-website-b01995c9dfa957acf8c5a06c323f4b548dca3bca.tar.bz2 metamuffin-website-b01995c9dfa957acf8c5a06c323f4b548dca3bca.tar.zst |
blog assets
-rw-r--r-- | src/blog/mod.rs | 1 | ||||
-rw-r--r-- | src/main.rs | 3 |
2 files changed, 3 insertions, 1 deletions
diff --git a/src/blog/mod.rs b/src/blog/mod.rs index b58750e..b301171 100644 --- a/src/blog/mod.rs +++ b/src/blog/mod.rs @@ -13,6 +13,7 @@ use std::{path::PathBuf, str::FromStr}; use tokio::fs::read_to_string; pub const ARTICLE_ROOT: &'static str = "./blog/articles"; +pub const ASSET_ROOT: &'static str = "./blog/assets"; #[get("/blog")] pub fn r_blog() -> Redirect { diff --git a/src/main.rs b/src/main.rs index 72bd891..85670c4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -13,7 +13,7 @@ pub mod wellknown; use blog::*; use error::*; use pages::*; -use rocket::{catchers, fairing::AdHoc, http::Header, routes}; +use rocket::{catchers, fairing::AdHoc, fs::FileServer, http::Header, routes}; use source::*; use wellknown::*; @@ -26,6 +26,7 @@ async fn main() { Box::pin(async {}) })) .manage(prepare_source()) + .mount("/blog/assets", FileServer::from(ASSET_ROOT)) .mount( "/", routes![ |