Using slugs dynamically

This commit is contained in:
Moris Zen
2018-06-25 15:28:50 +02:00
parent d145e29086
commit 7a67da8bb6
4 changed files with 2654 additions and 2557 deletions

View File

@@ -26,7 +26,10 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
result.data.allWordpressPage.edges.forEach(({ node }) => {
createPage({
path: node.slug,
component: path.resolve('./src/pages/page.js'),
component: path.resolve('./src/pages/page-default.js'),
context: {
slug: node.slug,
}
})
})