mirror of
https://github.com/maciejpedzich/maciejpedzi.ch.git
synced 2024-11-15 02:23:02 +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';
|
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
|
||||||
|
|
||||||
export async function GET(context) {
|
export async function GET(context) {
|
||||||
const posts = (await getCollection('blog')).sort(
|
const posts = (await getCollection('blog'))
|
||||||
(a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf()
|
.filter((p) => !p.data.draft)
|
||||||
);
|
.sort((a, b) => b.data.pubDate.valueOf() - a.data.pubDate.valueOf());
|
||||||
|
|
||||||
const { body } = await rss({
|
const { body } = await rss({
|
||||||
title: SITE_TITLE,
|
title: SITE_TITLE,
|
||||||
|
Loading…
Reference in New Issue
Block a user