diff options
author | Cara Salter <cara@devcara.com> | 2021-12-19 12:48:36 -0500 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2021-12-19 12:48:36 -0500 |
commit | c4d7f8f50d53057005d6bb28ac487f69ea45bd5e (patch) | |
tree | 34968e205ebbb97264a2df4e8951af5a01db22cb /src/blog/mod.rs | |
parent | ef01d3badb9765271a5bf55a4f0702b68f099e2e (diff) | |
download | site-c4d7f8f50d53057005d6bb28ac487f69ea45bd5e.tar.gz site-c4d7f8f50d53057005d6bb28ac487f69ea45bd5e.zip |
Add blog post parsing and templates
templates WIP, not building properly
Diffstat (limited to 'src/blog/mod.rs')
-rw-r--r-- | src/blog/mod.rs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/blog/mod.rs b/src/blog/mod.rs index 199d6db..3640bcd 100644 --- a/src/blog/mod.rs +++ b/src/blog/mod.rs @@ -1,10 +1,18 @@ +pub mod post; pub mod handlers { +use std::sync::Arc; + use warp::{Reply, Rejection}; use warp::http::Response; +use crate::templates::{self, Html, RenderRucte}; + +use crate::internal::SiteState; - pub async fn list() -> Result<impl Reply, Rejection> { - Ok("test") + pub async fn list(state: Arc<SiteState>) -> Result<impl Reply, Rejection> { + let state = state.clone(); + Response::builder() + .html(|o| templates::index_html(o)) } pub async fn post(name: String) -> Result<impl Reply, Rejection> { |