gatsby-plugin-feed-generator
A Gatsby plugin to generate JSON Feed and RSS feeds for markdown generated gatsby blogs. Currently limited to a single feed based on markdown pages. Feel free to add feature requests and use cases to the issues page.
Usage
Basic setup requires at minimum the following:
siteMetadata {
title: 'Gatsby',
description: 'A static site generator',
siteUrl: 'https://gatsbyjs.org',
author: 'Author Name'
},
plugins: [
{
resolve: 'gatsby-plugin-feed-generator'
}
]
Beyond that, you can customize the setup by setting options on the plugin. Below are the defaults. Include the needed changes.
plugins: [
{
resolve: 'gatsby-plugin-feed-generator',
options: {
generator: `GatsbyJS`,
rss: true,
json: true,
siteQuery: `
{
site {
siteMetadata {
title
description
siteUrl
author
}
}
}
`,
feedQuery: `
{
allMarkdownRemark(
sort: {order: DESC, fields: [frontmatter___date]},
limit: 100,
) {
edges {
node {
html
frontmatter {
date
path
title
}
}
}
}
}
`
}
}
]