use actix_web::http; use askama_actix::Template; use chrono::prelude::*; use serde::{Deserialize, Serialize}; use crate::cache; #[derive(Template)] #[template(path = "status_code.html")] pub struct StatusCode { pub status_code: http::StatusCode, pub message: Option, } #[derive(Template)] #[template(path = "web/index.html")] pub struct Index; #[derive(Template)] #[template(path = "web/about.html")] pub struct About; #[derive(Serialize, Deserialize, Debug)] pub struct PostIndexPost { pub name: String, pub slug: String, pub description: String, pub published_at: NaiveDate, pub edited_at: Option, pub tags: Vec, } #[derive(Template)] #[template(path = "web/posts/index.html")] pub struct Posts { pub posts: Vec, } #[derive(Template)] #[template(path = "web/posts/{slug}.html")] pub struct PostBySlug { // pub name: String, // pub slug: String, // pub published_at: NaiveDate, // pub edited_at: Option, // pub tags: Vec, // pub content: String, pub post: cache::Post, } #[derive(Template)] #[template(path = "web/tags/{name}.html")] pub struct TagByName { pub name: String, pub posts: Vec, }