Commit a32a042 1 parent d54f107 commit a32a042 Copy full SHA for a32a042
File tree 1 file changed +10
-10
lines changed
1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,8 @@ import { getCollection } from "astro:content";
7
7
const allPosts = await getCollection (" blog" );
8
8
const sortedPosts = allPosts .sort (
9
9
(a , b ) =>
10
- new Date (b .data .pubDate ).valueOf () - new Date (a .data .pubDate ).valueOf (),
10
+ new Date (b .data .datePublished ).valueOf () -
11
+ new Date (a .data .datePublished ).valueOf (),
11
12
);
12
13
13
14
const pageTitle = " Blog Posts" ;
@@ -42,16 +43,15 @@ const pageTitle = "Blog Posts";
42
43
class = { ` ${index !== 0 ? " border-t border-gray-100 dark:border-gray-700" : " " } ` }
43
44
>
44
45
<BlogPostListItem
45
- url = { ` /posts/${post .slug } ` }
46
+ url = { ` /posts/${post .data . slug } ` }
46
47
title = { post .data .title }
47
- datePublished = { new Date (post .data .pubDate ).toLocaleDateString (
48
- " en-US" ,
49
- {
50
- year: " numeric" ,
51
- month: " long" ,
52
- day: " numeric" ,
53
- },
54
- )}
48
+ datePublished = { new Date (
49
+ post .data .datePublished ,
50
+ ).toLocaleDateString (" en-US" , {
51
+ year: " numeric" ,
52
+ month: " long" ,
53
+ day: " numeric" ,
54
+ })}
55
55
description = { post .data .description }
56
56
/>
57
57
</div >
You can’t perform that action at this time.
0 commit comments