aboutsummaryrefslogtreecommitdiffstats
path: root/src/posts
diff options
context:
space:
mode:
Diffstat (limited to 'src/posts')
-rw-r--r--src/posts/mod.rs33
-rw-r--r--src/posts/note.rs1
2 files changed, 34 insertions, 0 deletions
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<T: Content> {
+ id: i64,
+ created_at: DateTime<Utc>,
+ updated_at: Option<DateTime<Utc>>,
+ post_type: PostType,
+ media: Option<Vec<Box<Path>>>,
+ content: Option<T>,
+ tags: Vec<String>,
+}
+
+pub trait Content {
+ fn render(&self) -> String;
+}
+
+// impl<T> Post<T> {
+// // renders as internal html (must sanitize)
+// fn new(type: PostType, ) -> Post<T> {
+// }
+// }
diff --git a/src/posts/note.rs b/src/posts/note.rs
index e69de29..95655d4 100644
--- a/src/posts/note.rs
+++ b/src/posts/note.rs
@@ -0,0 +1 @@
+struct note