mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
parent
d3e75d7f54
commit
524174a7c0
16
config.js
16
config.js
@ -18,5 +18,19 @@ module.exports = {
|
|||||||
githubContentPath:
|
githubContentPath:
|
||||||
'https://github.com/oceanprotocol/docs/blob/master/content',
|
'https://github.com/oceanprotocol/docs/blob/master/content',
|
||||||
githubDevOceanPath:
|
githubDevOceanPath:
|
||||||
'https://github.com/oceanprotocol/dev-ocean/blob/master/doc'
|
'https://github.com/oceanprotocol/dev-ocean/blob/master/doc',
|
||||||
|
redirects: [
|
||||||
|
{
|
||||||
|
from: '/concepts/',
|
||||||
|
to: '/concepts/introduction/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
from: '/setup/',
|
||||||
|
to: '/setup/quickstart/'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
from: '/tutorials/',
|
||||||
|
to: '/tutorials/introduction/'
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
|
/* eslint-disable no-console */
|
||||||
|
|
||||||
const path = require('path')
|
const path = require('path')
|
||||||
const { createFilePath } = require('gatsby-source-filesystem')
|
const { createFilePath } = require('gatsby-source-filesystem')
|
||||||
|
const { redirects } = require('./config')
|
||||||
|
|
||||||
exports.onCreateNode = ({ node, getNode, actions }) => {
|
exports.onCreateNode = ({ node, getNode, actions }) => {
|
||||||
const { createNodeField } = actions
|
const { createNodeField } = actions
|
||||||
@ -34,7 +37,20 @@ exports.onCreateNode = ({ node, getNode, actions }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.createPages = ({ graphql, actions }) => {
|
exports.createPages = ({ graphql, actions }) => {
|
||||||
const { createPage } = 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(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user