diff options
Diffstat (limited to 'src/components/Sections/LatestPosts.astro')
-rw-r--r-- | src/components/Sections/LatestPosts.astro | 6 |
1 files changed, 3 insertions, 3 deletions
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); </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> |