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/PostElement.astro | 6 ++++-- src/components/Sections/LatestPosts.astro | 6 +++--- src/content/blog/create-lib-file-from-dll.md | 5 +++-- src/content/blog/electron-reload.md | 5 +++-- src/content/blog/example-content.md | 5 +++-- src/content/blog/getting-source-code-of-chromium.md | 5 +++-- src/content/blog/installing-moodle-to-fedora.md | 5 +++-- src/content/blog/rust-and-tl-mr3020.md | 5 +++-- src/content/config.ts | 5 +++-- src/pages/404.astro | 1 + src/pages/blog/[...slug].astro | 13 ++++++++----- src/pages/blog/index.astro | 4 ++-- src/pages/index.astro | 1 + src/utils/schemas/blogPostSchema.ts | 15 ++++++++------- src/utils/schemas/blogSchema.ts | 2 +- src/utils/schemas/websiteSchema.ts | 4 +++- 16 files changed, 52 insertions(+), 35 deletions(-) diff --git a/src/components/PostElement.astro b/src/components/PostElement.astro index 85320ee..8b4b7c4 100644 --- a/src/components/PostElement.astro +++ b/src/components/PostElement.astro @@ -8,7 +8,9 @@ type Props = { const { post } = Astro.props; const { remarkPluginFrontmatter } = await post.render(); -const formattedDate = dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY"); + +const formattedDate = dayjs(post.data.datePublished.toString()).format("MMMM DD, YYYY"); +const datePublished = post.data.datePublished.toISOString(); ---