Created
May 18, 2020 12:15
-
-
Save diveddie/14c9e250535644e901e3b4175d4e9783 to your computer and use it in GitHub Desktop.
This is a function to create pages based on blog information.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
result.data.allContentfulBlogPost.edges.forEach(({ node }) => { | |
actions.createPage({ | |
path: `/blogs/${replaceSpacesWithDashes(node.title)}_${ | |
node.contentful_id | |
}`, | |
component: require.resolve( | |
`./src/components/InnerBlog/InnerBlog.tsx` | |
), | |
context: { data: node }, | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment