-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gatsby-plugin-feed feature request - dynamic feeds #3489
Comments
Here's what I changed in the plugin:
- for (let f of options.feeds) {
+ // options.feeds could be an array or a function
+ const newFeeds = typeof options.feeds === 'function' ? options.feeds({query: options.query}) : options.feeds;
+
+ for (let f of newFeeds) { |
@agarrharr The API isn't something I'm currently open to adding. I haven't read over all of the code above in detail, but it strikes me as needlessly complex. I think we can get similar functionality out of a simpler config. Would you be open to other approaches? |
Now, if you want to participate in the discussion that is happening over in #3413, where we're discussing how to improve configuration, your contributions are welcome there. But as this stands, it's duplicated work and an API I dislike as well. |
@nicholaswyoung I agree. It's very complex (the code I had to write for my site at least). But most of the code is just to add all of the relevant items the are needed for podcast rss feeds. There may be a better way, but I can't think of it right now. The code for the plugin is pretty simple, but I'm not sure if it would introduce any bugs. Another idea I had was to make a plugin specific to podcast feeds. |
Due to the high volume of issues, we're closing out older ones without recent activity. Please open a new issue if you need help! |
@nicholaswyoung
Description
As a user of
gatsby-plugin-feed
, I would like to be able to dynamically generate feeds. For example, I have a website that has multiple podcasts. I want to generate an rss feed for each of them automatically based on the data from Contentful (atpodcastname/feed.rss
). I also want a master feed atmaster.rss
.Environment
Gatsby version: ^1.9.145
Node.js version: v8.7.0
Operating System: macOS High Sierra 10.13.2
Example
I have actually done this with a small modification to the plugin, which I can submit as a pull request.
Here is an example of what I did.
The text was updated successfully, but these errors were encountered: