diff --git a/config.js b/config.js index 469a07bb..61d93973 100644 --- a/config.js +++ b/config.js @@ -18,5 +18,19 @@ module.exports = { githubContentPath: 'https://github.com/oceanprotocol/docs/blob/master/content', 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/' + } + ] } diff --git a/gatsby-config.js b/gatsby-config.js index 6464be02..05268c46 100755 --- a/gatsby-config.js +++ b/gatsby-config.js @@ -128,7 +128,12 @@ module.exports = { }, 'gatsby-plugin-catch-links', 'gatsby-plugin-react-helmet', - 'gatsby-plugin-sitemap', + { + resolve: 'gatsby-plugin-sitemap', + options: { + exclude: ['/test/'] + } + }, { resolve: 'gatsby-plugin-manifest', options: { diff --git a/gatsby-node.js b/gatsby-node.js index f393bf48..875525fd 100755 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -1,5 +1,8 @@ +/* eslint-disable no-console */ + const path = require('path') const { createFilePath } = require('gatsby-source-filesystem') +const { redirects } = require('./config') exports.onCreateNode = ({ node, getNode, actions }) => { const { createNodeField } = actions @@ -34,7 +37,7 @@ exports.onCreateNode = ({ node, getNode, actions }) => { } exports.createPages = ({ graphql, actions }) => { - const { createPage } = actions + const { createPage, createRedirect } = actions return new Promise((resolve, reject) => { resolve( @@ -122,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() }) ) diff --git a/scripts/deploy.sh b/scripts/deploy.sh index 1f668938..e67584fa 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -51,9 +51,9 @@ elif [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] | # ping search engines # returns: HTTP_STATUSCODE URL - # curl -sL -w "%{http_code} %{url_effective}\\n" \ - # "http://www.google.com/webmasters/tools/ping?sitemap=$SITEMAP_URL" -o /dev/null \ - # "http://www.bing.com/webmaster/ping.aspx?siteMap=$SITEMAP_URL" -o /dev/null + curl -sL -w "%{http_code} %{url_effective}\\n" \ + "http://www.google.com/webmasters/tools/ping?sitemap=$SITEMAP_URL" -o /dev/null \ + "http://www.bing.com/webmaster/ping.aspx?siteMap=$SITEMAP_URL" -o /dev/null echo "---------------------------------------------" echo " ✓ done deployment " diff --git a/src/components/Seo.jsx b/src/components/Seo.jsx index f39a235f..883468f8 100644 --- a/src/components/Seo.jsx +++ b/src/components/Seo.jsx @@ -83,8 +83,6 @@ const MetaTags = ({ {title &&