mirror of
https://github.com/kingomarnajjar/gatsby-starter-netlify-cms.git
synced 2026-07-25 22:27:24 +10:00
Small refactoring
This commit is contained in:
parent
28bdcfe81b
commit
c3cc1d252c
1 changed files with 5 additions and 3 deletions
|
|
@ -73,14 +73,16 @@ exports.createPages = ({ boundActionCreators, graphql }) => {
|
|||
}
|
||||
|
||||
return result.data.allMarkdownRemark.edges.forEach(({ node }) => {
|
||||
const pagePath = node.frontmatter.path;
|
||||
createPage({
|
||||
path: node.frontmatter.path,
|
||||
path: pagePath,
|
||||
component: path.resolve(
|
||||
`src/templates/${String(node.frontmatter.templateKey)}.js`
|
||||
),
|
||||
// additional data can be passed via context
|
||||
context: {
|
||||
path: node.frontmatter.path
|
||||
} // additional data can be passed via context
|
||||
path: pagePath
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue