mirror of
https://github.com/maciejpedzich/maciejpedzi.ch.git
synced 2024-11-14 18:13:03 +01:00
Prevent drafts from being added to the RSS feed
This commit is contained in:
parent
b86b16836c
commit
35c5c4a39e
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user