Static site generator + my presonnal website written in rust for some reason.
1use askama::Template; 2use serde::{Serialize,Deserialize}; 3 4#[derive(Template)] 5#[template(path="index.html")] 6pub struct IndexTemplate<'a> { 7 pub random_quote: &'a str, 8 pub index_post_entries: &'a Vec<IndexPostEntry> 9} 10 11#[derive(Template)] 12#[template(path="about.html")] 13pub struct AboutTemplate<'a> { 14 pub about_content: &'a String, 15} 16 17#[derive(Template)] 18#[template(path="404.html")] 19pub struct NotFoundTemplate { 20} 21 22#[derive(Template)] 23#[template(path="blog_entry.html")] 24pub struct BlogTemplate<'a> { 25 pub front_matter: &'a BlogInfo, 26 pub blog_content: &'a String, 27} 28 29#[derive(Debug,Serialize,Deserialize)] 30pub struct BlogInfo { 31 pub title: String, 32 pub date: String, 33} 34 35#[derive(Debug,Serialize,Deserialize,PartialEq, Eq, PartialOrd, Ord)] 36pub struct IndexPostEntry { 37 pub title: String, 38 pub date: String, 39 pub path: String, 40}