From f28cf8f2f9a7171f97c36150409317db33f4963d Mon Sep 17 00:00:00 2001 From: Jack Date: Tue, 3 Dec 2024 22:41:31 +0800 Subject: [PATCH] Add top blog --- src/components/PostPage.astro | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/components/PostPage.astro b/src/components/PostPage.astro index 088b2030a..f7d9a4eb1 100644 --- a/src/components/PostPage.astro +++ b/src/components/PostPage.astro @@ -7,9 +7,15 @@ const { page } = Astro.props let delay = 0 const interval = 50 + +const topBlogEntry = page.data.filter(entry => entry.title == siteConfig.topBlog)[0] + +const orderedData = [topBlogEntry, page.data.filter(entry => entry.title != siteConfig.topBlog)] + + ---
- {page.data.map((entry: { + {orderedData.map((entry: { data: { draft: boolean; title: string;