mirror of
https://github.com/kremalicious/gatsby-redirect-from.git
synced 2024-12-22 17:23:24 +01:00
Allow for the markdown query to be
This commit is contained in:
parent
feb0d1574d
commit
1303d79e36
@ -1,14 +1,16 @@
|
|||||||
import chalk from 'chalk'
|
import chalk from 'chalk'
|
||||||
|
|
||||||
export function createPages({ graphql, actions }) {
|
export function createPages({ graphql, actions }, pluginOptions) {
|
||||||
const { createRedirect } = actions
|
const { createRedirect } = actions
|
||||||
|
|
||||||
|
const markdownQuery = pluginOptions.query || 'allMarkdownRemark'
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(
|
resolve(
|
||||||
graphql(
|
graphql(
|
||||||
`
|
`
|
||||||
{
|
{
|
||||||
allMarkdownRemark(
|
${markdownQuery}(
|
||||||
filter: { frontmatter: { redirect_from: { ne: null } } }
|
filter: { frontmatter: { redirect_from: { ne: null } } }
|
||||||
) {
|
) {
|
||||||
edges {
|
edges {
|
||||||
|
Loading…
Reference in New Issue
Block a user