Skip to content

Commit

Permalink
Add a blog changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
dtuite committed Sep 5, 2023
1 parent 939dff5 commit 9f1c5cd
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion src/gatsby/rssFeedPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,54 @@ const changelogFeed = {
`,

output: '/changelog/rss.xml',
title: 'Roadie Changelog (legacy)',
};

const blogChangelogFeed = {
serialize: ({ query: { site, blogs } }) => {
return blogs.edges.map(({ node }) => {
return {
title: node.title,
date: node.date,
description: get(node, 'description.childMarkdownRemark.rawMarkdownBody'),
url: site.siteMetadata.siteUrl + node.slug,
guid: site.siteMetadata.siteUrl + node.slug,
custom_elements: [{
'content:encoded': get(node, 'body.childMarkdownRemark.html'),
}],
};
});
},

query: `
query AllChangelogBlogPosts {
blogs: allContentfulBlogPost(
sort: {fields: date, order: DESC}
filter: {tags: {eq: "changelog"}}
) {
edges {
node {
date
slug
title
body {
childMarkdownRemark {
html
}
}
description {
childMarkdownRemark {
rawMarkdownBody
}
}
}
}
}
}
`,
output: '/blog-changelog/rss.xml',
title: 'Roadie Changelog',
};

Expand All @@ -107,6 +155,6 @@ module.exports = [{
}
`,

feeds: [blogFeed, changelogFeed],
feeds: [blogFeed, changelogFeed, blogChangelogFeed],
},
}];

0 comments on commit 9f1c5cd

Please sign in to comment.