Update gatsby-node.js
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,6 @@
|
||||
node_modules/
|
||||
.cache/
|
||||
public
|
||||
|
||||
# ignore IDE
|
||||
.idea/
|
||||
|
||||
18
gatsby-node.js
Normal file
18
gatsby-node.js
Normal file
@@ -0,0 +1,18 @@
|
||||
exports.sourceNodes = ({ actions, createNodeId, createContentDigest }) => {
|
||||
const pokemons = [
|
||||
{ name: "Pikachu", type: "electric" },
|
||||
{ name: "Squirtle", type: "water" },
|
||||
]
|
||||
pokemons.forEach(pokemon => {
|
||||
const node = {
|
||||
name: pokemon.name,
|
||||
type: pokemon.type,
|
||||
id: createNodeId(`Pokemon-${pokemon.name}`),
|
||||
internal: {
|
||||
type: "Pokemon",
|
||||
contentDigest: createContentDigest(pokemon),
|
||||
},
|
||||
}
|
||||
actions.createNode(node)
|
||||
})
|
||||
}
|
||||
6896
package-lock.json
generated
6896
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user