mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-07-01 06:02:10 +02:00
move redirects into promise resolver
This commit is contained in:
parent
524174a7c0
commit
01b692fab0
|
@ -39,19 +39,6 @@ exports.onCreateNode = ({ node, getNode, actions }) => {
|
||||||
exports.createPages = ({ graphql, actions }) => {
|
exports.createPages = ({ graphql, actions }) => {
|
||||||
const { createPage, createRedirect } = actions
|
const { createPage, createRedirect } = actions
|
||||||
|
|
||||||
//
|
|
||||||
// create redirects
|
|
||||||
//
|
|
||||||
redirects.forEach(({ from, to }) => {
|
|
||||||
createRedirect({
|
|
||||||
fromPath: from,
|
|
||||||
redirectInBrowser: true,
|
|
||||||
toPath: to
|
|
||||||
})
|
|
||||||
|
|
||||||
console.log('Create redirect: ' + from + ' --> ' + to)
|
|
||||||
})
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(
|
resolve(
|
||||||
graphql(
|
graphql(
|
||||||
|
@ -138,6 +125,19 @@ exports.createPages = ({ graphql, actions }) => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
//
|
||||||
|
// create redirects
|
||||||
|
//
|
||||||
|
redirects.forEach(({ from, to }) => {
|
||||||
|
createRedirect({
|
||||||
|
fromPath: from,
|
||||||
|
redirectInBrowser: true,
|
||||||
|
toPath: to
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log('Create redirect: ' + from + ' --> ' + to)
|
||||||
|
})
|
||||||
|
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user