diff options
author | Cara Salter <cara@devcara.com> | 2022-02-02 02:23:50 -0500 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2022-02-02 02:23:50 -0500 |
commit | 8b2d12e799d01059843a8eeb1eb8ff3899d2d274 (patch) | |
tree | f0fe36dd5e225e42253997e0faa233317ea0117d /src/main.rs | |
parent | 22ee6a2efacb608647edc6f834b6949c0c73d199 (diff) | |
download | site-8b2d12e799d01059843a8eeb1eb8ff3899d2d274.tar.gz site-8b2d12e799d01059843a8eeb1eb8ff3899d2d274.zip |
internal: Make footnotes work
Apparently, the footnotes and superscript extensions conflicted with
each other.
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/main.rs b/src/main.rs index 0726f87..a83c1ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,13 +3,13 @@ extern crate tracing; use color_eyre::eyre::Result; use std::{net::IpAddr, sync::Arc}; -use warp::{Filter, path}; +use warp::{path, Filter}; use std::str::FromStr; pub mod blog; -pub mod misc; mod internal; +pub mod misc; use internal::SiteState; @@ -19,7 +19,6 @@ async fn main() -> Result<()> { tracing_subscriber::fmt::init(); info!("Starting launch of {}", env!("GIT_SHA")); - // Load .env kankyo::init(); @@ -27,15 +26,19 @@ async fn main() -> Result<()> { let index = warp::get().and(path::end().and_then(misc::handlers::index)); - let blog_index = warp::path!("blog").and(give_site_state(state.clone())).and_then(blog::handlers::list); - - let blog_post = warp::path!("blog" / String).and(give_site_state(state.clone())).and_then(blog::handlers::post); - + let blog_index = warp::path!("blog") + .and(give_site_state(state.clone())) + .and_then(blog::handlers::list); + let blog_post = warp::path!("blog" / String) + .and(give_site_state(state.clone())) + .and_then(blog::handlers::post); - let static_files = warp::path("static") - .and(warp::fs::dir("./statics")); - let site = index.or(blog_index.or(blog_post)).or(static_files).with(warp::log("site")); + let static_files = warp::path("static").and(warp::fs::dir("./statics")); + let site = index + .or(blog_index.or(blog_post)) + .or(static_files) + .with(warp::log("site")); let server = warp::serve(site); @@ -51,7 +54,9 @@ async fn main() -> Result<()> { Ok(()) } -fn give_site_state(sitestate: Arc<SiteState>) -> impl Filter<Extract = (Arc<SiteState>,), Error=std::convert::Infallible> + Clone { +fn give_site_state( + sitestate: Arc<SiteState>, +) -> impl Filter<Extract = (Arc<SiteState>,), Error = std::convert::Infallible> + Clone { warp::any().map(move || sitestate.clone()) } |