mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
Merge pull request #76 from oceanprotocol/feature/indexing
Search engine indexing
This commit is contained in:
commit
92d8f6fe5a
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/'
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
@ -128,7 +128,12 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
'gatsby-plugin-catch-links',
|
'gatsby-plugin-catch-links',
|
||||||
'gatsby-plugin-react-helmet',
|
'gatsby-plugin-react-helmet',
|
||||||
'gatsby-plugin-sitemap',
|
{
|
||||||
|
resolve: 'gatsby-plugin-sitemap',
|
||||||
|
options: {
|
||||||
|
exclude: ['/test/']
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
resolve: 'gatsby-plugin-manifest',
|
resolve: 'gatsby-plugin-manifest',
|
||||||
options: {
|
options: {
|
||||||
|
@ -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,7 @@ exports.onCreateNode = ({ node, getNode, actions }) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
exports.createPages = ({ graphql, actions }) => {
|
exports.createPages = ({ graphql, actions }) => {
|
||||||
const { createPage } = actions
|
const { createPage, createRedirect } = actions
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
resolve(
|
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()
|
resolve()
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
|
@ -51,9 +51,9 @@ elif [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] |
|
|||||||
|
|
||||||
# ping search engines
|
# ping search engines
|
||||||
# returns: HTTP_STATUSCODE URL
|
# returns: HTTP_STATUSCODE URL
|
||||||
# curl -sL -w "%{http_code} %{url_effective}\\n" \
|
curl -sL -w "%{http_code} %{url_effective}\\n" \
|
||||||
# "http://www.google.com/webmasters/tools/ping?sitemap=$SITEMAP_URL" -o /dev/null \
|
"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
|
"http://www.bing.com/webmaster/ping.aspx?siteMap=$SITEMAP_URL" -o /dev/null
|
||||||
|
|
||||||
echo "---------------------------------------------"
|
echo "---------------------------------------------"
|
||||||
echo " ✓ done deployment "
|
echo " ✓ done deployment "
|
||||||
|
@ -83,8 +83,6 @@ const MetaTags = ({
|
|||||||
|
|
||||||
{title && <title>{title}</title>}
|
{title && <title>{title}</title>}
|
||||||
|
|
||||||
<meta name="robots" content="noindex, nofollow" />
|
|
||||||
|
|
||||||
{/* General tags */}
|
{/* General tags */}
|
||||||
<meta name="description" content={description} />
|
<meta name="description" content={description} />
|
||||||
<meta name="image" content={image} />
|
<meta name="image" content={image} />
|
||||||
|
@ -1,57 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
import { Link, graphql } from 'gatsby'
|
|
||||||
import Layout from '../components/Layout'
|
|
||||||
import HeaderSection from '../components/HeaderSection'
|
|
||||||
import Content from '../components/Content'
|
|
||||||
|
|
||||||
const SetupIndexPage = ({ data, location }) => {
|
|
||||||
const { edges } = data.allMarkdownRemark
|
|
||||||
|
|
||||||
const SetupList = edges.map(({ node }) => {
|
|
||||||
const { title } = node.frontmatter
|
|
||||||
const { slug } = node.fields
|
|
||||||
|
|
||||||
return (
|
|
||||||
<li key={node.id}>
|
|
||||||
<Link to={slug}>{title}</Link>
|
|
||||||
</li>
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Layout location={location}>
|
|
||||||
<HeaderSection title={['Setup Guides']} />
|
|
||||||
<Content>
|
|
||||||
<ul>{SetupList}</ul>
|
|
||||||
</Content>
|
|
||||||
</Layout>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default SetupIndexPage
|
|
||||||
|
|
||||||
SetupIndexPage.propTypes = {
|
|
||||||
data: PropTypes.object.isRequired,
|
|
||||||
location: PropTypes.object.isRequired
|
|
||||||
}
|
|
||||||
|
|
||||||
export const indexQuery = graphql`
|
|
||||||
query {
|
|
||||||
allMarkdownRemark(filter: { fields: { section: { eq: "setup" } } }) {
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
id
|
|
||||||
html
|
|
||||||
excerpt(pruneLength: 250)
|
|
||||||
frontmatter {
|
|
||||||
title
|
|
||||||
}
|
|
||||||
fields {
|
|
||||||
slug
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
@ -1,59 +0,0 @@
|
|||||||
import React from 'react'
|
|
||||||
import PropTypes from 'prop-types'
|
|
||||||
import { Link, graphql } from 'gatsby'
|
|
||||||
import Layout from '../components/Layout'
|
|
||||||
import HeaderSection from '../components/HeaderSection'
|
|
||||||
import Content from '../components/Content'
|
|
||||||
|
|
||||||
const TutorialsIndexPage = ({ data, location }) => {
|
|
||||||
const { edges } = data.allMarkdownRemark
|
|
||||||
|
|
||||||
const TutorialsList = edges.map(({ node }) => {
|
|
||||||
const { title } = node.frontmatter
|
|
||||||
const { slug } = node.fields
|
|
||||||
|
|
||||||
return (
|
|
||||||
<li key={node.id}>
|
|
||||||
<Link to={slug}>{title}</Link>
|
|
||||||
</li>
|
|
||||||
)
|
|
||||||
})
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Layout location={location}>
|
|
||||||
<HeaderSection title={['Tutorials']} />
|
|
||||||
<Content>
|
|
||||||
<ul>{TutorialsList}</ul>
|
|
||||||
</Content>
|
|
||||||
</Layout>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default TutorialsIndexPage
|
|
||||||
|
|
||||||
TutorialsIndexPage.propTypes = {
|
|
||||||
data: PropTypes.object.isRequired,
|
|
||||||
location: PropTypes.object.isRequired
|
|
||||||
}
|
|
||||||
|
|
||||||
export const indexQuery = graphql`
|
|
||||||
query {
|
|
||||||
allMarkdownRemark(
|
|
||||||
filter: { fields: { section: { eq: "tutorials" } } }
|
|
||||||
) {
|
|
||||||
edges {
|
|
||||||
node {
|
|
||||||
id
|
|
||||||
html
|
|
||||||
excerpt(pruneLength: 250)
|
|
||||||
frontmatter {
|
|
||||||
title
|
|
||||||
}
|
|
||||||
fields {
|
|
||||||
slug
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`
|
|
Loading…
x
Reference in New Issue
Block a user