blossom/src/posts/mod.rs

34 lines
562 B
Rust
Raw Normal View History

2023-05-30 21:48:26 +01:00
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> {
// }
// }