Skip to content

Instantly share code, notes, and snippets.

@rubenRP
Created April 27, 2020 07:29
Show Gist options
  • Save rubenRP/794f417f7d9d2d73ef2141e222744cd9 to your computer and use it in GitHub Desktop.
Save rubenRP/794f417f7d9d2d73ef2141e222744cd9 to your computer and use it in GitHub Desktop.
const tags = result.data.tagsGroup.group
tags.forEach(tag => {
createPage({
path: `/blog/tag:${tag.fieldValue.toLowerCase()}`,
component: tabPage,
context: {
tag: tag.fieldValue,
},
})
})
const categories = result.data.categoriesGroup.group
categories.forEach(category => {
createPage({
path: `/blog/category:${category.fieldValue.toLowerCase()}`,
component: categoryPage,
context: {
category: category.fieldValue,
},
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment