Remove Moris and Wordpress
This commit is contained in:
@@ -1,43 +1,43 @@
|
||||
const path = require('path')
|
||||
|
||||
exports.createPages = ({ graphql, boundActionCreators }) => {
|
||||
const { createPage } = boundActionCreators
|
||||
return new Promise((resolve, reject) => {
|
||||
graphql(
|
||||
`
|
||||
{
|
||||
allWordpressPost {
|
||||
edges {
|
||||
node {
|
||||
slug
|
||||
status
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
).then(result => {
|
||||
if (result.errors) {
|
||||
console.log(result.errors)
|
||||
reject(result.errors)
|
||||
}
|
||||
//exports.createPages = ({ graphql, boundActionCreators }) => {
|
||||
//const { createPage } = boundActionCreators
|
||||
//return new Promise((resolve, reject) => {
|
||||
//graphql(
|
||||
//`
|
||||
//{
|
||||
//allWordpressPost {
|
||||
//edges {
|
||||
//node {
|
||||
//slug
|
||||
//status
|
||||
//}
|
||||
//}
|
||||
//}
|
||||
//}
|
||||
//`
|
||||
//).then(result => {
|
||||
//if (result.errors) {
|
||||
//console.log(result.errors)
|
||||
//reject(result.errors)
|
||||
//}
|
||||
|
||||
createPage({
|
||||
path: `/blog/`,
|
||||
component: path.resolve('./src/templates/blog.js'),
|
||||
})
|
||||
//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,
|
||||
},
|
||||
})
|
||||
})
|
||||
//result.data.allWordpressPost.edges.forEach(({ node }) => {
|
||||
//createPage({
|
||||
//path: `blog/${node.slug}`,
|
||||
//component: path.resolve('./src/templates/post-default.js'),
|
||||
//context: {
|
||||
//slug: node.slug,
|
||||
//},
|
||||
//})
|
||||
//})
|
||||
|
||||
resolve()
|
||||
})
|
||||
})
|
||||
}
|
||||
//resolve()
|
||||
//})
|
||||
//})
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user