From 4e24495b159df0dbc4f503843c08ccd452af616a Mon Sep 17 00:00:00 2001 From: cel 🌸 Date: Tue, 30 May 2023 21:48:26 +0100 Subject: WIP: blog --- src/posts/mod.rs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'src/posts/mod.rs') diff --git a/src/posts/mod.rs b/src/posts/mod.rs index e69de29..b0c3749 100644 --- a/src/posts/mod.rs +++ b/src/posts/mod.rs @@ -0,0 +1,33 @@ +use chrono::{DateTime, Utc}; +use std::path::Path; + +enum PostType { + Article, + Note, +} + +enum TextFormat { + Markdown, + Plaintext, + Html, +} + +pub struct Post { + id: i64, + created_at: DateTime, + updated_at: Option>, + post_type: PostType, + media: Option>>, + content: Option, + tags: Vec, +} + +pub trait Content { + fn render(&self) -> String; +} + +// impl Post { +// // renders as internal html (must sanitize) +// fn new(type: PostType, ) -> Post { +// } +// } -- cgit