mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-06-03 07:26:45 +00:00
@@ -3,8 +3,9 @@ import { getGlobalNotionData } from '@/lib/notion/getNotionData'
|
|||||||
|
|
||||||
export async function getServerSideProps ({ res }) {
|
export async function getServerSideProps ({ res }) {
|
||||||
res.setHeader('Content-Type', 'text/xml')
|
res.setHeader('Content-Type', 'text/xml')
|
||||||
const globalNotionData = await getGlobalNotionData({ from: 'rss' })
|
// 获取最新文章
|
||||||
const xmlFeed = await generateRss(globalNotionData?.allPosts?.slice(0, 10) || [])
|
const globalNotionData = await getGlobalNotionData({ from: 'rss', latestPostCount: 5 })
|
||||||
|
const xmlFeed = await generateRss(globalNotionData?.latestPosts || [])
|
||||||
res.write(xmlFeed)
|
res.write(xmlFeed)
|
||||||
res.end()
|
res.end()
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user