-
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
feat(gatsby-plugin-feed): add feedUrl plugin option #13826
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,29 @@ module.exports = { | |
title: `assetPrefix + pathPrefix RSS Feed`, | ||
output: `rss.xml`, | ||
}, | ||
{ | ||
query: ` | ||
{ | ||
pages: allSitePage { | ||
nodes { | ||
path | ||
} | ||
} | ||
} | ||
`, | ||
serialize({ query: { site, pages } }) { | ||
return pages.nodes.map(node => { | ||
return { | ||
description: `A sample page hello world suh dude`, | ||
date: `10-08-1990`, | ||
url: `${site.siteMetadata.siteUrl}${pathPrefix}${node.path}`, | ||
} | ||
}) | ||
}, | ||
title: `feedUrl RSS Feed`, | ||
feedUrl: `http://localhost:9000/rss-2.xml`, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So in this case, output isn't used whatsoever? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For clarity/conciseness then, it'd probably be a good idea to not include the output file in feedUrl, and infer it from the existing output? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that actually fits my use case: I left intentionally as a escape-hatch for even more complex cases, where an user can opt-out of the magic. I can rewrite this portion if needed (: (but I think we should change it to something like There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (not suggesting you change the name--just an observation!) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, siteUrl is set to |
||
output: `rss-2.xml`, | ||
}, | ||
], | ||
}, | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for adding these!