mirror of
https://github.com/kremalicious/gatsby-redirect-from.git
synced 2025-02-17 07:26:59 +01:00
Merge pull request #15 from kremalicious/dependabot/npm_and_yarn/prettier-2.0.5
Bump prettier from 1.19.1 to 2.0.5
This commit is contained in:
commit
660ca7dbfc
@ -29,7 +29,7 @@
|
|||||||
"eslint": "^5.16.0",
|
"eslint": "^5.16.0",
|
||||||
"eslint-config-prettier": "^4.3.0",
|
"eslint-config-prettier": "^4.3.0",
|
||||||
"eslint-plugin-prettier": "^3.1.0",
|
"eslint-plugin-prettier": "^3.1.0",
|
||||||
"prettier": "^1.18.2",
|
"prettier": "^2.0.5",
|
||||||
"release-it": "^12.3.0"
|
"release-it": "^12.3.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
@ -26,7 +26,7 @@ export function createPages({ graphql, actions }, pluginOptions) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
).then(result => {
|
).then((result) => {
|
||||||
if (result.errors) {
|
if (result.errors) {
|
||||||
console.log(result.errors) // eslint-disable-line no-console
|
console.log(result.errors) // eslint-disable-line no-console
|
||||||
reject(result.errors)
|
reject(result.errors)
|
||||||
@ -38,7 +38,7 @@ export function createPages({ graphql, actions }, pluginOptions) {
|
|||||||
|
|
||||||
// For all posts with redirect_from frontmatter,
|
// For all posts with redirect_from frontmatter,
|
||||||
// extract all values and push to redirects array
|
// extract all values and push to redirects array
|
||||||
allPosts.forEach(post => {
|
allPosts.forEach((post) => {
|
||||||
redirects.push({
|
redirects.push({
|
||||||
from: post.node.frontmatter.redirect_from,
|
from: post.node.frontmatter.redirect_from,
|
||||||
to: post.node.fields.slug
|
to: post.node.fields.slug
|
||||||
@ -48,7 +48,7 @@ export function createPages({ graphql, actions }, pluginOptions) {
|
|||||||
// Create redirects from the just constructed array
|
// Create redirects from the just constructed array
|
||||||
redirects.forEach(({ from, to }) => {
|
redirects.forEach(({ from, to }) => {
|
||||||
// iterate through all `from` array items
|
// iterate through all `from` array items
|
||||||
from.forEach(from => {
|
from.forEach((from) => {
|
||||||
createRedirect({
|
createRedirect({
|
||||||
fromPath: from,
|
fromPath: from,
|
||||||
toPath: to,
|
toPath: to,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user