diff --git a/src/gatsby-node.js b/src/gatsby-node.js index 911b125..af78071 100644 --- a/src/gatsby-node.js +++ b/src/gatsby-node.js @@ -1,14 +1,16 @@ import chalk from 'chalk' -export function createPages({ graphql, actions }) { +export function createPages({ graphql, actions }, pluginOptions) { const { createRedirect } = actions + const markdownQuery = pluginOptions.query || 'allMarkdownRemark' + return new Promise((resolve, reject) => { resolve( graphql( ` { - allMarkdownRemark( + ${markdownQuery}( filter: { frontmatter: { redirect_from: { ne: null } } } ) { edges {