diff --git a/gatsby-node.js b/gatsby-node.js index 12faef0..8c1300b 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -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, - } + }, }) }) diff --git a/src/pages/blog.js b/src/pages/blog.js deleted file mode 100644 index 66a487d..0000000 --- a/src/pages/blog.js +++ /dev/null @@ -1,9 +0,0 @@ -import React from 'react' - -const BlogPage = () => ( -