2018-06-25 09:19:20 +02:00
|
|
|
const path = require('path')
|
|
|
|
|
|
2019-01-25 05:07:49 -08:00
|
|
|
//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)
|
|
|
|
|
//}
|
2018-06-25 10:53:58 +02:00
|
|
|
|
2019-01-25 05:07:49 -08:00
|
|
|
//createPage({
|
|
|
|
|
//path: `/blog/`,
|
|
|
|
|
//component: path.resolve('./src/templates/blog.js'),
|
|
|
|
|
//})
|
2018-07-05 20:43:56 +02:00
|
|
|
|
2019-01-25 05:07:49 -08:00
|
|
|
//result.data.allWordpressPost.edges.forEach(({ node }) => {
|
|
|
|
|
//createPage({
|
|
|
|
|
//path: `blog/${node.slug}`,
|
|
|
|
|
//component: path.resolve('./src/templates/post-default.js'),
|
|
|
|
|
//context: {
|
|
|
|
|
//slug: node.slug,
|
|
|
|
|
//},
|
|
|
|
|
//})
|
|
|
|
|
//})
|
2018-06-25 10:53:58 +02:00
|
|
|
|
2019-01-25 05:07:49 -08:00
|
|
|
//resolve()
|
|
|
|
|
//})
|
|
|
|
|
//})
|
|
|
|
|
//}
|