feat(guide): Import guide in to the client app
This commit is contained in:
16
client/plugins/gatsby-remark-node-identity/gatsby-node.js
Normal file
16
client/plugins/gatsby-remark-node-identity/gatsby-node.js
Normal file
@ -0,0 +1,16 @@
|
||||
exports.onCreateNode = ({ node, reporter }, { predicate, identity }) => {
|
||||
if (typeof predicate !== 'function') {
|
||||
reporter.panic(
|
||||
'Please supply a predicate function to `gatsby-plugin-identity`'
|
||||
);
|
||||
}
|
||||
if (typeof identity !== 'string' || identity.lenght === 0) {
|
||||
reporter.panic(
|
||||
'`gatsby-plugin-identity` requires an identify string to add to nodes ' +
|
||||
'that match the predicate'
|
||||
);
|
||||
}
|
||||
if (predicate(node)) {
|
||||
node.internal.identity = identity;
|
||||
}
|
||||
};
|
1
client/plugins/gatsby-remark-node-identity/package.json
Normal file
1
client/plugins/gatsby-remark-node-identity/package.json
Normal file
@ -0,0 +1 @@
|
||||
{"name": "gatsby-plugin-node-identity", "version": "0.1.0"}
|
Reference in New Issue
Block a user