mottox2 / gatsby-source-rss-feed

Gatsby source plugin for rss feed.
https://www.npmjs.com/package/gatsby-source-rss-feed
24 stars 6 forks source link

Support RSS-parser 3.7.4 #9

Closed maxsteenbergen closed 4 years ago

maxsteenbergen commented 4 years ago

Recently, RSS-Parser added a fix to support custom fields at the top level of RSS feeds instead of nested within items -> https://github.com/rbren/rss-parser/issues/94

I tried patching gatsby-node.js to get it properly picked up by GraphQL but my experience with Gatsby's internals is way too limited. I can confirm that the following setup retrieves the RSS feed correctly. I'd imagine that this would result in a StandingHS1.ranking object that, in this case, would house the array.

{
      resolve: `gatsby-source-rss-feed`,
      options: {
        url: `https://api.nevobo.nl/export/poule/regio-west/HPC/stand.rss`, //Stand HS1
        name: `StandingHS1`,
        parserOption: {
          customFields: {
            feed: [
              ["stand:ranking", "ranking", {keepArray: true}],
            ],
          }
        }
      }
    },
mottox2 commented 4 years ago

I updated rss-parser to 3.7.6.