diff --git a/services/rss/src/routes/all-published-content.js b/services/rss/src/routes/all-published-content.js index 6790d7273..7a0c5a476 100644 --- a/services/rss/src/routes/all-published-content.js +++ b/services/rss/src/routes/all-published-content.js @@ -30,7 +30,7 @@ module.exports = asyncRoute(async (req, res) => { const { edges } = data.allPublishedContent; const parts = [ - '', + '', createChannel({ title: channel.title || `Published Content Feed | ${website.name}`, link: channel.link || website.origin, diff --git a/services/rss/src/routes/website-scheduled-content.js b/services/rss/src/routes/website-scheduled-content.js index 17722157a..fa82afd99 100644 --- a/services/rss/src/routes/website-scheduled-content.js +++ b/services/rss/src/routes/website-scheduled-content.js @@ -47,7 +47,7 @@ module.exports = asyncRoute(async (req, res) => { const { section, edges } = data.websiteScheduledContent; const parts = [ - '', + '', createChannel({ title: channel.title || `${section.fullName || section.name} | ${website.name}`, link: channel.link || `${website.origin}${section.canonicalPath}`, @@ -58,5 +58,5 @@ module.exports = asyncRoute(async (req, res) => { }), '', ]; - res.end(parts.join('')); + res.end(parts.join('\n')); }); diff --git a/services/rss/src/utils/create-channel.js b/services/rss/src/utils/create-channel.js index 56c3a28d2..b3aea72ab 100644 --- a/services/rss/src/utils/create-channel.js +++ b/services/rss/src/utils/create-channel.js @@ -17,5 +17,5 @@ module.exports = ({ `${xml.encode(description)}`, ]; if (language) parts.push(`${language}`); - return `${parts.join('')}${items.join('')}`; + return `${parts.join('\n')}${items.join('\n')}`; }; diff --git a/services/rss/src/utils/create-item.js b/services/rss/src/utils/create-item.js index 9c65e2ded..d57cbc5f8 100644 --- a/services/rss/src/utils/create-item.js +++ b/services/rss/src/utils/create-item.js @@ -42,10 +42,12 @@ module.exports = ({ } const imageMediaTags = getAsArray(images, 'edges').reduce((arr, { node }) => { const { src } = node; - if (src) arr.push(``); + if (src) { + arr.push(``); + } return arr; }, []); if (imageMediaTags.length) parts.push(...imageMediaTags); if (embedSrc) parts.push(``); - return `${parts.join('')}`; + return `${parts.join('\n')}`; };