gatsby-source-rss-feeds

gatsby source parser for rss feeds


Keywords
gatsby, source, rss
License
MIT
Install
npm install gatsby-source-rss-feeds@1.0.1

Documentation

gatsby-source-rss-feeds

Source plugin for pulling data into Gatsby from RSS feed based on gatsby-source-rss-feed.


Build Status version MIT License

The problem

When loading a xml file with empty values, gatsby-source-rss-feed converted the rss in objects which in turn gave errors.

This solution

Build on the plugin and make sure the empty fields are handled.

Table of Contents

Installation

This module should be installed as one of your project's dependencies:

npm install --save gatsby-source-rss-feeds

Usage

basic pattern

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-rss-feeds`,
      options: {
        url: `https://www.gatsbyjs.org/blog/rss.xml`,
        name: `GatsbyBlog`,
      }
    }
  ]
}

use multiple feed

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-rss-feeds`,
      options: {
        url: `https://www.gatsbyjs.org/blog/rss.xml`,
        name: `GatsbyBlog`,
      }
    }
    {
      resolve: `gatsby-source-rss-feeds`,
      options: {
        url: `https://www.gatsbyjs.org/blog/rss.xml`,
        name: `MyBlog`,
      }
    }
  ]
}

How to query

Query is Feed${name}.

When name of options is GatsbyBlog, query named as FeedGatsbyBlog.

{
  allFeedGatsbyBlog {
    edges {
      node {
        title
        link
        content
      }
    }
  }

  feedGatsbyBlog {
    title
    link
    content
  }
}