Skip to content

Commit

Permalink
Merge pull request #10 from alirussell/master
Browse files Browse the repository at this point in the history
Support alternative markdown queries (such as allMdx)
  • Loading branch information
kremalicious committed Jun 10, 2019
2 parents feb0d15 + 8bc3e67 commit ee987af
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 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(
q: ${markdownQuery}(
filter: { frontmatter: { redirect_from: { ne: null } } }
) {
edges {
Expand All @@ -30,7 +32,7 @@ export function createPages({ graphql, actions }) {
reject(result.errors)
}

const allPosts = result.data.allMarkdownRemark.edges
const allPosts = result.data.q.edges

const redirects = []

Expand Down

0 comments on commit ee987af

Please sign in to comment.