Skip to content

Commit

Permalink
fix(data-structure): filtered meeting slug creation to only meetings
Browse files Browse the repository at this point in the history
  • Loading branch information
travi committed Jun 20, 2018
1 parent 2ae5444 commit 7069efa
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ exports.createPages = ({graphql, boundActionCreators}) => {
allMarkdownRemark {
edges {
node {
frontmatter {
date
}
fields {
slug
}
Expand All @@ -31,11 +34,13 @@ exports.createPages = ({graphql, boundActionCreators}) => {
}
`).then(result => {
result.data.allMarkdownRemark.edges.forEach(({node}) => {
createPage({
path: node.fields.slug,
component: path.resolve('./src/templates/meeting.js'),
context: {slug: node.fields.slug}
});
if (node.frontmatter.date) {
createPage({
path: node.fields.slug,
component: path.resolve('./src/templates/meeting.js'),
context: {slug: node.fields.slug}
});
}
});
});
};

0 comments on commit 7069efa

Please sign in to comment.