From 17f9a467d7c0f427ae9d1cd579988a26615311c7 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Sat, 14 Jun 2025 11:25:17 +0000 Subject: refactor: update blog post date handling and schema - Replaced `pubDate` with `datePublished` in blog post components for consistency. - Updated sorting logic in blog sections to use `datePublished`. - Enhanced blog post schema to include `dateModified` for better structured data representation. - Adjusted various blog markdown files to reflect the new date fields. --- src/components/Sections/LatestPosts.astro | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/components/Sections/LatestPosts.astro') diff --git a/src/components/Sections/LatestPosts.astro b/src/components/Sections/LatestPosts.astro index e91cb4c..e514ff5 100644 --- a/src/components/Sections/LatestPosts.astro +++ b/src/components/Sections/LatestPosts.astro @@ -7,7 +7,7 @@ const posts = await getCollection("blog", ({ data }) => { return data.draft !== true; }); -posts.sort((a, b) => b.data.pubDate.getTime() - a.data.pubDate.getTime()); +posts.sort((a, b) => b.data.datePublished.getTime() - a.data.datePublished.getTime()); const latestPosts = posts.slice(0, 5); --- @@ -32,8 +32,8 @@ const latestPosts = posts.slice(0, 5); - -- cgit v1.2.3