feat(model): extend Post with cover_image, reading_time, word_count, toc_html, prev/next nav
This commit is contained in:
parent
cf783d8f6e
commit
203591ff65
@ -40,6 +40,12 @@ pub struct Post {
|
|||||||
pub created_at: DateTime<Utc>,
|
pub created_at: DateTime<Utc>,
|
||||||
pub updated_at: DateTime<Utc>,
|
pub updated_at: DateTime<Utc>,
|
||||||
pub tags: Vec<String>,
|
pub tags: Vec<String>,
|
||||||
|
pub cover_image: Option<String>,
|
||||||
|
pub reading_time: u32,
|
||||||
|
pub word_count: u32,
|
||||||
|
pub toc_html: Option<String>,
|
||||||
|
pub prev_post: Option<PostNav>,
|
||||||
|
pub next_post: Option<PostNav>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Post {
|
impl Post {
|
||||||
@ -50,6 +56,12 @@ impl Post {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
|
pub struct PostNav {
|
||||||
|
pub title: String,
|
||||||
|
pub slug: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Tag {
|
pub struct Tag {
|
||||||
pub id: i32,
|
pub id: i32,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user