Slide 61
Slide 61 text
ಋೖࣄྫΛͲ͏࣮ͬͯݱ͔ͨ͠
// Tag pages:
let tags = []
_.each(cases, edge => {
if (_.get(edge, 'node.frontmatter.tags')) {
tags = tags.concat(edge.node.frontmatter.tags)
}
})
tags = _.uniq(tags)
tags.forEach(tag => {
createPage({
path: `/cases/tags/${_.kebabCase(tag)}/`,
component: tagTemplate,
context: {
tag,
},
})
})
gatsby-node.js