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 () => {
|
||||
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({
|
||||
title: siteConfig.title,
|
||||
description: siteConfig.description + '\nfeedId:76245438397618182+userId:62156866798228480',
|
||||
site: import.meta.env.SITE,
|
||||
items: posts.map((post) => ({
|
||||
title: post.data.title ?? '',
|
||||
description: `${post.data.description ?? ''}`,
|
||||
pubDate: post.data.date,
|
||||
link: `/blog/${post.slug}`
|
||||
}))
|
||||
items
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user