From 2622aabe075d836868971e0f9abe73267213cc78 Mon Sep 17 00:00:00 2001 From: saicaca Date: Sat, 20 Jul 2024 23:47:40 +0800 Subject: [PATCH] fix: sort post list in RSS by time and exclude draft posts --- src/pages/rss.xml.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/rss.xml.ts b/src/pages/rss.xml.ts index d4e9872..ef37031 100644 --- a/src/pages/rss.xml.ts +++ b/src/pages/rss.xml.ts @@ -3,10 +3,11 @@ import {siteConfig} from '@/config'; import { getCollection } from 'astro:content'; import sanitizeHtml from 'sanitize-html'; import MarkdownIt from 'markdown-it'; +import {getSortedPosts} from "@utils/content-utils.ts"; const parser = new MarkdownIt(); export async function GET(context: any) { - const blog = await getCollection('posts'); + const blog = await getSortedPosts(); return rss({ title: siteConfig.title, description: siteConfig.subtitle || 'No description',