From c4d7f8f50d53057005d6bb28ac487f69ea45bd5e Mon Sep 17 00:00:00 2001 From: Cara Salter Date: Sun, 19 Dec 2021 12:48:36 -0500 Subject: Add blog post parsing and templates templates WIP, not building properly --- src/blog/mod.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/blog/mod.rs') 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 { - Ok("test") + pub async fn list(state: Arc) -> Result { + let state = state.clone(); + Response::builder() + .html(|o| templates::index_html(o)) } pub async fn post(name: String) -> Result { -- cgit v1.2.3