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/pages/blog/index.astro | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pages/blog/index.astro') diff --git a/src/pages/blog/index.astro b/src/pages/blog/index.astro index fd8b376..de5a0a9 100644 --- a/src/pages/blog/index.astro +++ b/src/pages/blog/index.astro @@ -10,10 +10,10 @@ 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 postsByYear = posts.reduce[]>>((acc, post) => { - const year = post.data.pubDate.getFullYear().toString(); + const year = post.data.datePublished.getFullYear().toString(); if (!acc[year]) { acc[year] = []; } -- cgit v1.2.3