bugfix: rss修复

This commit is contained in:
tangly1024
2022-01-19 11:27:09 +08:00
parent f65ef5551b
commit f1590f52e8

View File

@@ -3,8 +3,8 @@ import { getGlobalNotionData } from '@/lib/notion/getNotionData'
export async function getServerSideProps ({ res }) {
res.setHeader('Content-Type', 'text/xml')
const { allPosts } = getGlobalNotionData({ from: 'rss' })
const xmlFeed = generateRss(allPosts.slice(0, 10))
const globalNotionData = await getGlobalNotionData({ from: 'rss' })
const xmlFeed = generateRss(globalNotionData?.allPosts?.slice(0, 10) || [])
res.write(xmlFeed)
res.end()
return {