Creating Blog Page for listing
This commit is contained in:
@@ -22,13 +22,18 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
|
||||
reject(result.errors)
|
||||
}
|
||||
|
||||
createPage({
|
||||
path: `/blog/`,
|
||||
component: path.resolve('./src/templates/blog.js'),
|
||||
})
|
||||
|
||||
result.data.allWordpressPost.edges.forEach(({ node }) => {
|
||||
createPage({
|
||||
path: `blog/${node.slug}`,
|
||||
component: path.resolve('./src/templates/post-default.js'),
|
||||
context: {
|
||||
slug: node.slug,
|
||||
}
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user