Creating latest posts pages and not pages dynamically for now
This commit is contained in:
@@ -6,12 +6,10 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
|
||||
graphql(
|
||||
`
|
||||
{
|
||||
allWordpressPage {
|
||||
allWordpressPost {
|
||||
edges {
|
||||
node {
|
||||
id
|
||||
slug
|
||||
title
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,10 +21,10 @@ exports.createPages = ({ graphql, boundActionCreators }) => {
|
||||
reject(result.errors)
|
||||
}
|
||||
|
||||
result.data.allWordpressPage.edges.forEach(({ node }) => {
|
||||
result.data.allWordpressPost.edges.forEach(({ node }) => {
|
||||
createPage({
|
||||
path: node.slug,
|
||||
component: path.resolve('./src/pages/page-default.js'),
|
||||
path: `blog/${node.slug}`,
|
||||
component: path.resolve('./src/pages/post-default.js'),
|
||||
context: {
|
||||
slug: node.slug,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user