use askama::Template; use serde::{Serialize,Deserialize}; #[derive(Template)] #[template(path="index.html")] pub struct IndexTemplate<'a> { pub random_quote: &'a str, pub index_post_entries: &'a Vec } #[derive(Template)] #[template(path="about.html")] pub struct AboutTemplate<'a> { pub about_content: &'a String, } #[derive(Template)] #[template(path="404.html")] pub struct NotFoundTemplate { } #[derive(Template)] #[template(path="blog_entry.html")] pub struct BlogTemplate<'a> { pub front_matter: &'a BlogInfo, pub blog_content: &'a String, } #[derive(Debug,Serialize,Deserialize)] pub struct BlogInfo { pub title: String, pub date: String, } #[derive(Debug,Serialize,Deserialize,PartialEq, Eq, PartialOrd, Ord)] pub struct IndexPostEntry { pub title: String, pub date: String, pub path: String, }