mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01: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 }) => {
|
||||
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) => {
|
||||
resolve(
|
||||
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()
|
||||
})
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user