Gatsby source plugin for rss feed
npm install gatsby-source-rss-feed
Source plugin for pulling data into Gatsby from RSS feed.
``bash`
npm install --save gatsby-source-rss-feed
or
`bash`
yarn add gatsby-source-rss-feed
`jsgatsby-source-rss-feed
// In your gatsby-config.js
module.exports = {
plugins: [
{
resolve: ,https://www.gatsbyjs.org/blog/rss.xml
options: {
url: ,GatsbyBlog
name: ,`
// Optional
// Read parser document: https://github.com/bobby-brennan/rss-parser#readme
parserOption: {
customFields: {
item: ['itunes:duration']
}
}
}
}
]
}
Query is Feed${name}.
When name of options is GatsbyBlog, query named as FeedGatsbyBlog.
`graphql
{
allFeedGatsbyBlog {
edges {
node {
title
link
content
}
}
}
feedGatsbyBlog {
title
link
content
}
}
`
Data not part of the items can be accessed with Feed${name}Meta
When name of options is GatsbyBlog, query named as FeedGatsbyBlogMeta.
`graphql``
{
feedGatsbyBlogMeta {
title
author
description
lastBuiltDate
}
}