mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-19 23:16:48 +00:00
hexo主题 新增category、tag分页
This commit is contained in:
17
pages/feed/index.js
Normal file
17
pages/feed/index.js
Normal file
@@ -0,0 +1,17 @@
|
||||
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 = await generateRss(globalNotionData?.latestPosts || [])
|
||||
res.write(xmlFeed)
|
||||
res.end()
|
||||
return {
|
||||
props: {}
|
||||
}
|
||||
}
|
||||
|
||||
const feed = () => null
|
||||
export default feed
|
||||
Reference in New Issue
Block a user