mirror of
https://github.com/ClovertaTheTrilobita/SanYeCao-blog.git
synced 2026-04-02 01:54:50 +00:00
Merge branch 'master' into blog-content
This commit is contained in:
commit
0176c4ebd8
1 changed files with 11 additions and 8 deletions
|
|
@ -4,20 +4,23 @@ import { getCollection } from 'astro:content';
|
||||||
|
|
||||||
export async function GET(context) {
|
export async function GET(context) {
|
||||||
const posts = await getCollection("blog");
|
const posts = await getCollection("blog");
|
||||||
const [postLang, ...slugParts] = post.id.split("/");
|
|
||||||
const slug = slugParts.join("/");
|
|
||||||
|
|
||||||
return rss({
|
return rss({
|
||||||
title: 'Cloverta的博客',
|
title: 'Cloverta的博客',
|
||||||
description: '在这里,发现更多(雾)欢迎来到三叶的博客🥳',
|
description: '在这里,发现更多(雾)欢迎来到三叶的博客🥳',
|
||||||
site: context.site,
|
site: context.site,
|
||||||
items: await pagesGlobToRssItems(import.meta.glob('./**/*.md')),
|
items: await pagesGlobToRssItems(import.meta.glob('./**/*.md')),
|
||||||
items: posts.map((post) => ({
|
items: posts.map((post) => {
|
||||||
|
const [postLang, ...slugParts] = post.id.split("/");
|
||||||
|
const slug = slugParts.join("/");
|
||||||
|
|
||||||
|
return ({
|
||||||
title: post.data.title,
|
title: post.data.title,
|
||||||
pubDate: post.data.pubDate,
|
pubDate: post.data.pubDate,
|
||||||
description: post.data.description,
|
description: post.data.description,
|
||||||
link: `/zh/posts/${slug}/`,
|
link: `/zh/posts/${slug}/`,
|
||||||
})),
|
})
|
||||||
|
}),
|
||||||
customData: `<language>en-us</language>`,
|
customData: `<language>en-us</language>`,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue