Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/darenmalfait/gatsby-source-rss-feeds

gatsby source parser for rss feeds
https://github.com/darenmalfait/gatsby-source-rss-feeds

Last synced: about 15 hours ago
JSON representation

gatsby source parser for rss feeds

Awesome Lists containing this project

README

        


gatsby-source-rss-feeds

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


---

[![Build Status][build-badge]][build]
[![version][version-badge]][package]
[![MIT License][license-badge]][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](#installation)
- [Usage](#usage)
- [basic pattern](#basic-pattern)
- [use multiple feed](#use-multiple-feed)
- [How to query](#how-to-query)

## Installation

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

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

## Usage

### basic pattern

```js
// 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

```js
// 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`.

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

feedGatsbyBlog {
title
link
content
}
}
```

[npm]: https://www.npmjs.com
[node]: https://nodejs.org
[build-badge]: https://img.shields.io/github/workflow/status/daren-malfait/gatsby-source-rss-feeds/CI?logo=github&style=flat-square
[build]: https://github.com/daren-malfait/gatsby-source-rss-feeds/actions?query=workflow
[version-badge]: https://img.shields.io/npm/v/gatsby-source-rss-feeds.svg?style=flat-square
[package]: https://www.npmjs.com/package/gatsby-source-rss-feeds
[downloads-badge]: https://img.shields.io/npm/dm/gatsby-source-rss-feeds.svg?style=flat-square
[license-badge]: https://img.shields.io/npm/l/gatsby-source-rss-feeds.svg?style=flat-square
[license]: https://github.com/daren-malfait/gatsby-source-rss-feeds/blob/main/LICENSE