File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change 1
- import rss , { pagesGlobToRssItems } from "@astrojs/rss" ;
1
+ import rss from "@astrojs/rss" ;
2
2
3
3
export async function GET ( context ) {
4
+ const postImportResult = import . meta. glob ( "../content/posts/**/*.mdx" , {
5
+ eager : true ,
6
+ } ) ;
7
+ const posts = Object . values ( postImportResult ) ;
8
+
4
9
return rss ( {
5
10
title : "Astro Learner | Blog" ,
6
11
description : "My journey learning Astro" ,
7
12
site : context . site ,
8
- items : await pagesGlobToRssItems (
9
- import . meta. glob ( "../content/posts/**/*.mdx" )
10
- ) ,
11
- customData : `<language>en-us</language>` ,
13
+ items : posts . map ( ( post ) => ( {
14
+ title : post . frontmatter . title ,
15
+ description : post . frontmatter . spoiler ,
16
+ link : post . frontmatter . href ,
17
+ pubDate : new Date ( post . frontmatter . date ) ,
18
+ } ) ) ,
12
19
} ) ;
13
20
}
You can’t perform that action at this time.
0 commit comments