mirror of
https://github.com/valentineus/popov.link.git
synced 2025-07-04 00:20:26 +03:00
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.
This commit is contained in:
@ -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);
|
||||
</a>
|
||||
|
||||
<small>
|
||||
<time datetime={post.data.pubDate.toISOString()} lang="en">
|
||||
{dayjs(post.data.pubDate.toString()).format("MMMM DD, YYYY")}
|
||||
<time datetime={post.data.datePublished.toISOString()} lang="en">
|
||||
{dayjs(post.data.datePublished.toString()).format("MMMM DD, YYYY")}
|
||||
</time>
|
||||
</small>
|
||||
</li>
|
||||
|
Reference in New Issue
Block a user