mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-18 23:16:49 +00:00
调整RSS方案,节省流量
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import fs from 'fs'
|
||||
import { Feed } from 'feed'
|
||||
import BLOG from '@/blog.config'
|
||||
import ReactDOMServer from 'react-dom/server'
|
||||
@@ -44,5 +45,9 @@ export async function generateRss(posts) {
|
||||
date: new Date(post?.date?.start_date || post?.createdTime)
|
||||
})
|
||||
}
|
||||
return feed.atom1()
|
||||
|
||||
fs.mkdirSync('./public/rss', { recursive: true })
|
||||
fs.writeFileSync('./public/rss/feed.xml', feed.rss2())
|
||||
fs.writeFileSync('./public/rss/atom.xml', feed.atom1())
|
||||
fs.writeFileSync('./public/rss/feed.json', feed.json1())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user