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
Enhance API for multiple feeds #1548
Conversation
Deploy preview ready! Built with commit 90e1c5a78361b3c56355c3c6aac843b832887ea3 |
Deploy preview ready! Built with commit 90e1c5a78361b3c56355c3c6aac843b832887ea3 |
Deploy preview ready! Built with commit 50ed083 |
// https://stackoverflow.com/questions/13852852/surely-es6-must-have-a-way-to-merge-two-javascript-objects-together-what-is-it | ||
const isObject = item => item && typeof item === 'object' && !Array.isArray(item) | ||
|
||
export function mergeDeep(target, ...sources) { |
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.
Any reason not to use the lodash function?
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.
If that's preferable, cool. I don't care either way. No other reason besides this doesn't pull in a library for one function.
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.
Lodash is used in the core Gatsby package as well as in many of the other plugins which makes it effectively "free" for you to use here.
const ctx = { ...globals, ...locals } | ||
const feed = new RSS(setup({ ...rest, ...ctx })) | ||
const items = f.serialize ? f.serialize(ctx) : serialize(ctx) | ||
console.log(locals) |
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.
Extra console.log
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.
Good catch. I should probably standardize on the debug
module for things like this.
Deploy preview ready! Built with commit 50ed083 |
Deploy preview ready! Built with commit 90e1c5a78361b3c56355c3c6aac843b832887ea3 |
Deploy preview ready! Built with commit 50ed083 |
@KyleAMathews The issues you mentioned should be resolved now. |
Actually, hold up. I have one more change to go in. |
👍 Okay, ready to go. @KyleAMathews |
Deploy preview failed. Built with commit af44327fbeed412f975459eb55408278accdda11 https://app.netlify.com/sites/using-remark/deploys/596ed8416f4c501fa84cd31f |
👍 |
This enhances the feeds plugin API when defining multiple feeds, but also keeps sensible defaults.