This source plugin for Gatsby will load episode metadata from a podcast rss feed and make it available in GraphQL queries.
npm install --save gatsby-source-podcast-rss-feed
or
yarn add gatsby-source-podcast-rss-feed
// In your `gatsby-config.js`
module.exports = {
plugins: [
{
resolve: `gatsby-source-podcast-rss-feed`,
options: {
feedURL: `https://some.url/yourpodcastfeed.rss`,
id: 'guid',
},
},
],
}
Set feedURL
to a live podcast rss feed.
Optional.
Determines which field in the given feedURL, within the podcast episode entries, to use as a unique id / key for each episode.
Defaults to using link
if you don't include it here in the options.
Once the plugin is configured, two new queries are available in GraphQL: allpodcastRssFeedEpisode
and podcastRssFeedEpisode
.
Here’s an example query to load the three (3) most recent episodes from your podcast rss feed:
query PodcastQuery {
allPodcastRssFeedEpisode(limit: 3) {
nodes {
item {
title
link
itunes {
duration
}
}
}
}
}
See Apple Podcasts Connect Help or Google Feed Requirements for info about podcast rss feed specification.