mirror of
https://github.com/KazooTTT/kazoottt-blog.git
synced 2025-06-23 10:41:31 +08:00
feat: add full content for rss
This commit is contained in:
@ -5,15 +5,24 @@ import { getAllSortedPosts } from '@/utils'
|
|||||||
export const GET = async () => {
|
export const GET = async () => {
|
||||||
const posts = await getAllSortedPosts()
|
const posts = await getAllSortedPosts()
|
||||||
|
|
||||||
|
const items = await Promise.all(
|
||||||
|
posts.map(async (post) => {
|
||||||
|
const entry = post
|
||||||
|
const body = entry.body
|
||||||
|
|
||||||
|
return {
|
||||||
|
title: post.data.title ?? '',
|
||||||
|
description: JSON.stringify(body),
|
||||||
|
pubDate: post.data.date,
|
||||||
|
link: `/blog/${post.slug}`
|
||||||
|
}
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
return rss({
|
return rss({
|
||||||
title: siteConfig.title,
|
title: siteConfig.title,
|
||||||
description: siteConfig.description + '\nfeedId:76245438397618182+userId:62156866798228480',
|
description: siteConfig.description + '\nfeedId:76245438397618182+userId:62156866798228480',
|
||||||
site: import.meta.env.SITE,
|
site: import.meta.env.SITE,
|
||||||
items: posts.map((post) => ({
|
items
|
||||||
title: post.data.title ?? '',
|
|
||||||
description: `${post.data.description ?? ''}`,
|
|
||||||
pubDate: post.data.date,
|
|
||||||
link: `/blog/${post.slug}`
|
|
||||||
}))
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user