utf-8 encode rss
This commit is contained in:
parent
cb9922b373
commit
41323883a5
|
@ -31,7 +31,7 @@ const generateRssItem = (item) => {
|
||||||
|
|
||||||
export default function generateRssFeed (items) {
|
export default function generateRssFeed (items) {
|
||||||
const itemsList = items.map(generateRssItem)
|
const itemsList = items.map(generateRssItem)
|
||||||
return `
|
return `<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
||||||
<channel>
|
<channel>
|
||||||
<title>${SITE_TITLE}</title>
|
<title>${SITE_TITLE}</title>
|
||||||
|
|
|
@ -17,7 +17,7 @@ export async function getServerSideProps ({ req, res }) {
|
||||||
|
|
||||||
if (!items || error) return emptyProps
|
if (!items || error) return emptyProps
|
||||||
|
|
||||||
res.setHeader('Content-Type', 'text/xml')
|
res.setHeader('Content-Type', 'text/xml; charset=utf-8')
|
||||||
res.write(generateRssFeed(items))
|
res.write(generateRssFeed(items))
|
||||||
res.end()
|
res.end()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue