From 511e7b8e41c0ab408611ed20517158a06903f22a Mon Sep 17 00:00:00 2001 From: ClovertaTheTrilobita Date: Mon, 30 Mar 2026 18:04:35 +0300 Subject: [PATCH] fix rss --- src/pages/rss.xml.js | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/pages/rss.xml.js b/src/pages/rss.xml.js index 0091c90..1981d41 100644 --- a/src/pages/rss.xml.js +++ b/src/pages/rss.xml.js @@ -4,20 +4,23 @@ import { getCollection } from 'astro:content'; export async function GET(context) { const posts = await getCollection("blog"); - const [postLang, ...slugParts] = post.id.split("/"); - const slug = slugParts.join("/"); return rss({ title: 'Cloverta的博客', description: '在这里,发现更多(雾)欢迎来到三叶的博客🥳', site: context.site, items: await pagesGlobToRssItems(import.meta.glob('./**/*.md')), - items: posts.map((post) => ({ - title: post.data.title, - pubDate: post.data.pubDate, - description: post.data.description, - link: `/zh/posts/${slug}/`, - })), + items: posts.map((post) => { + const [postLang, ...slugParts] = post.id.split("/"); + const slug = slugParts.join("/"); + + return ({ + title: post.data.title, + pubDate: post.data.pubDate, + description: post.data.description, + link: `/zh/posts/${slug}/`, + }) + }), customData: `en-us`, }) } \ No newline at end of file