Skip to content

Commit

Permalink
Allow for the markdown query to be
Browse files Browse the repository at this point in the history
  • Loading branch information
alirussell committed Jan 8, 2019
1 parent feb0d15 commit 1303d79
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/gatsby-node.js
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit 1303d79

Please sign in to comment.