fix: use feed.xml instead of index.xml

This commit is contained in:
Timothy Lin
2021-07-11 23:03:27 +08:00
parent af917001a0
commit e66018ba56
3 changed files with 3 additions and 16 deletions

View File

@ -33,7 +33,7 @@ export async function getStaticProps({ params }) {
// rss
const rss = generateRss(allPosts)
fs.writeFileSync('./public/index.xml', rss)
fs.writeFileSync('./public/feed.xml', rss)
return { props: { post, authorDetails, prev, next } }
}

View File

@ -30,10 +30,10 @@ export async function getStaticProps({ params }) {
)
// rss
const rss = generateRss(filteredPosts, `tags/${params.tag}/index.xml`)
const rss = generateRss(filteredPosts, `tags/${params.tag}/feed.xml`)
const rssPath = path.join(root, 'public', 'tags', params.tag)
fs.mkdirSync(rssPath, { recursive: true })
fs.writeFileSync(path.join(rssPath, 'index.xml'), rss)
fs.writeFileSync(path.join(rssPath, 'feed.xml'), rss)
return { props: { posts: filteredPosts, tag: params.tag } }
}