mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 07:26:52 +00:00
17 lines
460 B
JavaScript
17 lines
460 B
JavaScript
import { generateRss } from '@/lib/rss'
|
|
import { getGlobalNotionData } from '@/lib/notion/getNotionData'
|
|
|
|
export async function getServerSideProps ({ res }) {
|
|
res.setHeader('Content-Type', 'text/xml')
|
|
const globalNotionData = await getGlobalNotionData({ from: 'rss' })
|
|
const xmlFeed = generateRss(globalNotionData?.allPosts?.slice(0, 10) || [])
|
|
res.write(xmlFeed)
|
|
res.end()
|
|
return {
|
|
props: {}
|
|
}
|
|
}
|
|
|
|
const feed = () => null
|
|
export default feed
|