diff --git a/src/pages/rss.xml.js b/src/pages/rss.xml.js index b5b4631..3a76fa3 100644 --- a/src/pages/rss.xml.js +++ b/src/pages/rss.xml.js @@ -3,9 +3,9 @@ import { getCollection } from 'astro:content'; import { SITE_TITLE, SITE_DESCRIPTION } from '../consts'; export async function GET(context) { - const posts = (await getCollection('blog')).sort( - (a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf() - ); + const posts = (await getCollection('blog')) + .filter((p) => !p.data.draft) + .sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()); const { body } = await rss({ title: SITE_TITLE,