From 203591ff6570533e784b489249aba36a654b2003 Mon Sep 17 00:00:00 2001 From: xfy Date: Tue, 2 Jun 2026 18:13:04 +0800 Subject: [PATCH] feat(model): extend Post with cover_image, reading_time, word_count, toc_html, prev/next nav --- src/models/post.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/models/post.rs b/src/models/post.rs index 2b27b12..cdfdba2 100644 --- a/src/models/post.rs +++ b/src/models/post.rs @@ -40,6 +40,12 @@ pub struct Post { pub created_at: DateTime, pub updated_at: DateTime, pub tags: Vec, + pub cover_image: Option, + pub reading_time: u32, + pub word_count: u32, + pub toc_html: Option, + pub prev_post: Option, + pub next_post: Option, } 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)] pub struct Tag { pub id: i32,