From 8658ddefe71579ad68b7c0754cbe3c8fb4cbe447 Mon Sep 17 00:00:00 2001 From: Marshall Ku Date: Tue, 20 Feb 2024 08:25:04 +0900 Subject: [PATCH] Fix last build date in feed temporarily --- apps/blog/app/[category]/feed/route.ts | 3 ++- apps/blog/app/feed/route.tsx | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/blog/app/[category]/feed/route.ts b/apps/blog/app/[category]/feed/route.ts index 5c66d736..7862b0cb 100644 --- a/apps/blog/app/[category]/feed/route.ts +++ b/apps/blog/app/[category]/feed/route.ts @@ -18,7 +18,8 @@ export async function GET(_: Request, { params }: { params: { category: string } }); const posts = getPosts(); - const lastBuildDate = new Date(posts[0].data.date.modified || posts[0].data.date.posted).toUTCString(); + // FIXME: Should calculate it in build time + const lastBuildDate = new Date().toUTCString(); const categories = getCategories(); const host = "https://marshallku.com"; const formattedPosts = await Promise.all( diff --git a/apps/blog/app/feed/route.tsx b/apps/blog/app/feed/route.tsx index 7bdd83d6..207e89bd 100644 --- a/apps/blog/app/feed/route.tsx +++ b/apps/blog/app/feed/route.tsx @@ -18,7 +18,8 @@ export async function GET() { }); const posts = getPosts(); - const lastBuildDate = new Date(posts[0].data.date.modified || posts[0].data.date.posted).toUTCString(); + // FIXME: SHould calculate it in build time + const lastBuildDate = new Date().toUTCString(); const categories = getCategories(); const host = "https://marshallku.com"; const formattedPosts = await Promise.all(