We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63c3e8c commit da5ce00Copy full SHA for da5ce00
src/pages/rss.xml.js
@@ -21,12 +21,14 @@ export async function GET(context) {
21
site: context.site,
22
// Array of `<item>`s in output xml
23
// See "Generating items" section for examples using content collections and glob imports
24
- items: ideas.map(idea => ({
25
- title : idea.data.title,
26
- pubDate : idea.data.pubDate,
27
- description: idea.data.description,
28
- link: `/idea/${slug(idea)}`,
29
- })),
+ items: ideas
+ .filter(idea => idea.data.pubDate)
+ .map(idea => ({
+ title : idea.data.title,
+ pubDate : idea.data.pubDate,
+ description: idea.data.description,
30
+ link: `/idea/${slug(idea)}`,
31
+ })),
32
33
trailingSlash: false,
34
// (optional) inject custom xml
0 commit comments