Skip to content

Commit

Permalink
Cleanup example for the createPages API (#5216)
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews authored May 2, 2018
1 parent b640559 commit c7dcb6f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/gatsby/src/utils/api-node-docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ exports.resolvableExtensions = true
* // Create blog post pages.
* result.data.allMarkdownRemark.edges.forEach(edge => {
* createPage({
* path: `${edge.node.fields.slug}`, // required
* component: slash(blogPostTemplate),
* path: `edge.node.fields.slug`, // required
* component: blogPostTemplate,
* context: {
* slug: edge.node.fields.slug,
* // Add optional context data. Data can be used as
* // arguments to the page GraphQL query.
* //
* // The page "path" is always available as a GraphQL
* // argument.
* },
* })
* })
Expand Down

0 comments on commit c7dcb6f

Please sign in to comment.