1
0
mirror of https://github.com/kremalicious/gatsby-redirect-from.git synced 2024-12-22 09:13:20 +01:00

formatting changes

This commit is contained in:
Matthias Kretschmann 2020-05-17 01:58:03 +02:00
parent 85ec3b06ac
commit b8322b2f3c
Signed by: m
GPG Key ID: 606EEEF3C479A91F

View File

@ -26,7 +26,7 @@ export function createPages({ graphql, actions }, pluginOptions) {
}
}
`
).then(result => {
).then((result) => {
if (result.errors) {
console.log(result.errors) // eslint-disable-line no-console
reject(result.errors)
@ -38,7 +38,7 @@ export function createPages({ graphql, actions }, pluginOptions) {
// For all posts with redirect_from frontmatter,
// extract all values and push to redirects array
allPosts.forEach(post => {
allPosts.forEach((post) => {
redirects.push({
from: post.node.frontmatter.redirect_from,
to: post.node.fields.slug
@ -48,7 +48,7 @@ export function createPages({ graphql, actions }, pluginOptions) {
// Create redirects from the just constructed array
redirects.forEach(({ from, to }) => {
// iterate through all `from` array items
from.forEach(from => {
from.forEach((from) => {
createRedirect({
fromPath: from,
toPath: to,