Skip to content

Commit c81fd7f

Browse files
authored
Improve website RSS feed (#3895)
This fixes links and authors in the channel tag and the item tags.
1 parent cb4236d commit c81fd7f

File tree

1 file changed

+12
-21
lines changed

1 file changed

+12
-21
lines changed

website/gatsby-config.js

+12-21
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,10 @@ module.exports = {
187187
...options,
188188
id: baseUrl,
189189
title,
190-
link: baseUrl,
190+
site_url: baseUrl,
191191
description,
192192
copyright: `All rights reserved ${currentYear}, ${company}`,
193-
author: {
194-
name: author,
195-
link: "https://twitter.com/Chilli_Cream",
196-
},
193+
author,
197194
generator: "ChilliCream",
198195
image: `${baseUrl}/favicon-32x32.png`,
199196
favicon: `${baseUrl}/favicon-32x32.png`,
@@ -242,37 +239,31 @@ module.exports = {
242239
},
243240
},
244241
}) =>
245-
allMdx.edges.map(({ node }) => {
246-
const date = new Date(Date.parse(node.frontmatter.date));
242+
allMdx.edges.map(({ node: { excerpt, frontmatter, body } }) => {
243+
const date = new Date(Date.parse(frontmatter.date));
247244
const imgSrcPattern = new RegExp(
248245
`(${pathPrefix})?/static/`,
249246
"g"
250247
);
251-
const link = siteUrl + pathPrefix + node.frontmatter.path;
252-
let image = node.frontmatter.featuredImage
248+
const link = siteUrl + pathPrefix + frontmatter.path;
249+
let image = frontmatter.featuredImage
253250
? siteUrl +
254-
node.frontmatter.featuredImage.childImageSharp
251+
frontmatter.featuredImage.childImageSharp
255252
.gatsbyImageData.src
256253
: null;
257254

258255
return {
259-
id: node.frontmatter.path,
260-
link,
261-
title: node.frontmatter.title,
256+
url: link,
257+
title: frontmatter.title,
262258
date,
263259
published: date,
264-
description: node.excerpt,
265-
content: node.body.replace(
260+
description: excerpt,
261+
content: body.replace(
266262
imgSrcPattern,
267263
`${siteUrl}/static/`
268264
),
269265
image,
270-
author: [
271-
{
272-
name: node.frontmatter.author,
273-
link: node.frontmatter.authorUrl,
274-
},
275-
],
266+
author: frontmatter.author,
276267
};
277268
}),
278269
title: "ChilliCream Blog",

0 commit comments

Comments
 (0)