diff options
author | Valentin Popov <valentin@popov.link> | 2025-06-14 14:25:17 +0300 |
---|---|---|
committer | Valentin Popov <valentin@popov.link> | 2025-06-14 14:25:17 +0300 |
commit | 17f9a467d7c0f427ae9d1cd579988a26615311c7 (patch) | |
tree | dfa72e6ca88f8ff1806477853d292dcef2b1255c /src/pages/blog/index.astro | |
parent | 3df02c5304b8faee540694b15041ad2ee43bc1b2 (diff) | |
download | popov.link-17f9a467d7c0f427ae9d1cd579988a26615311c7.tar.xz popov.link-17f9a467d7c0f427ae9d1cd579988a26615311c7.zip |
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.
Diffstat (limited to 'src/pages/blog/index.astro')
-rw-r--r-- | src/pages/blog/index.astro | 4 |
1 files changed, 2 insertions, 2 deletions
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<Record<string, CollectionEntry<"blog">[]>>((acc, post) => { - const year = post.data.pubDate.getFullYear().toString(); + const year = post.data.datePublished.getFullYear().toString(); if (!acc[year]) { acc[year] = []; } |