Allow for the markdown query to be

This commit is contained in:
Alistair Russell 2019-01-08 12:33:46 +00:00
parent feb0d1574d
commit 1303d79e36
1 changed files with 4 additions and 2 deletions

View File

@ -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 {