From 54eae0e7381cacbbda657f8d516136fface221dc Mon Sep 17 00:00:00 2001 From: xy <10816187@qq.com> Date: Fri, 24 Jul 2026 21:18:57 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=8D=9A=E5=AE=A2=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/PostList.astro | 8 +++----- src/types/post.ts | 7 +++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/components/PostList.astro b/src/components/PostList.astro index f8ab10c..4805a3a 100644 --- a/src/components/PostList.astro +++ b/src/components/PostList.astro @@ -46,11 +46,9 @@ posts.map((post) => {
{post.summary}
- - - - - +
+ {post.tags.map(tag =>
{tag.name}
)} +
diff --git a/src/types/post.ts b/src/types/post.ts index 55c1fd4..f801a85 100644 --- a/src/types/post.ts +++ b/src/types/post.ts @@ -1,3 +1,8 @@ +type Tag = { + id: number + code: string + name: string +} export type Post = { title: string; summary: string; @@ -7,6 +12,7 @@ export type Post = { published_at: string; view: number; content: string; + tags: Tag[] } export type CategoriesStats = { @@ -14,3 +20,4 @@ export type CategoriesStats = { name: string; post_count: number; } +