Created
April 28, 2019 19:49
-
-
Save danilowoz/aeb45b65526dd264469980929caccbd9 to your computer and use it in GitHub Desktop.
Getting the categories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const categories = [] | |
posts.forEach((post, index) => { | |
post.node.frontmatter.category.forEach(cat => categories.push(cat)) | |
createPage({ | |
path: post.node.fields.slug, | |
component: blogLayout, | |
context: { | |
slug: post.node.fields.slug, | |
}, | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment