From 184ff9351dd2ff58b97fb46ab18fc3e717d4677d Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Tue, 7 Apr 2026 23:26:08 +0800 Subject: [PATCH] Extract post list into reusable fragment Add public/fragments/post-list.html containing the shared post list markup, and update src/pages/category.astro and src/pages/index.astro to replace the in-file duplicate list with . This removes duplicated template code and centralizes the post list for easier maintenance; existing empty-feed and pagination logic remain unchanged. --- public/fragments/post-list.html | 19 +++++++++++++++++++ src/pages/category.astro | 22 ++-------------------- src/pages/index.astro | 22 ++-------------------- 3 files changed, 23 insertions(+), 40 deletions(-) create mode 100644 public/fragments/post-list.html diff --git a/public/fragments/post-list.html b/public/fragments/post-list.html new file mode 100644 index 0000000..5947964 --- /dev/null +++ b/public/fragments/post-list.html @@ -0,0 +1,19 @@ + diff --git a/src/pages/category.astro b/src/pages/category.astro index 701aacc..610f8d5 100644 --- a/src/pages/category.astro +++ b/src/pages/category.astro @@ -14,26 +14,8 @@ import Layout from "../layouts/Layout.astro";

- + +
暂无文章。
diff --git a/src/pages/index.astro b/src/pages/index.astro index 680f865..2aef3a5 100644 --- a/src/pages/index.astro +++ b/src/pages/index.astro @@ -6,26 +6,8 @@ import Layout from "../layouts/Layout.astro"; - + +