File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 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";
77const allPosts = await getCollection (" blog" );
88const sortedPosts = allPosts .sort (
99 (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 (),
1112);
1213
1314const pageTitle = " Blog Posts" ;
@@ -42,16 +43,15 @@ const pageTitle = "Blog Posts";
4243 class = { ` ${index !== 0 ? " border-t border-gray-100 dark:border-gray-700" : " " } ` }
4344 >
4445 <BlogPostListItem
45- url = { ` /posts/${post .slug } ` }
46+ url = { ` /posts/${post .data . slug } ` }
4647 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+ })}
5555 description = { post .data .description }
5656 />
5757 </div >
You can’t perform that action at this time.
0 commit comments