From d6126294bf27c93e0f05cbd3129e9b20493db6d0 Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Mon, 28 Feb 2022 09:34:37 -0500 Subject: Nix and updated templates --- src/main.rs | 3 ++- src/misc/mod.rs | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index a83c1ae..21eac18 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,7 @@ async fn main() -> Result<()> { let state = Arc::new(internal::init().await?); let index = warp::get().and(path::end().and_then(misc::handlers::index)); + let about = warp::path!("about").and_then(misc::handlers::about); let blog_index = warp::path!("blog") .and(give_site_state(state.clone())) @@ -35,7 +36,7 @@ async fn main() -> Result<()> { .and_then(blog::handlers::post); let static_files = warp::path("static").and(warp::fs::dir("./statics")); - let site = index + let site = index.or(about) .or(blog_index.or(blog_post)) .or(static_files) .with(warp::log("site")); diff --git a/src/misc/mod.rs b/src/misc/mod.rs index c2992cc..b5b3262 100644 --- a/src/misc/mod.rs +++ b/src/misc/mod.rs @@ -6,4 +6,8 @@ pub mod handlers { pub async fn index() -> Result { Response::builder().html(|o| templates::index_html(o)) } + + pub async fn about() -> Result { + Response::builder().html(|o| templates::about_html(o)) + } } -- cgit v1.2.3