2018-11-11 01:32:05 +01:00
|
|
|
require('dotenv').config()
|
2018-11-10 21:08:10 +01:00
|
|
|
|
|
|
|
if (!process.env.GITHUB_TOKEN) {
|
|
|
|
throw new Error(
|
|
|
|
`A GitHub token is required to build the site. Check the README
|
|
|
|
\nhttps://github.com/oceanprotocol/docs.`
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2018-11-10 15:12:41 +01:00
|
|
|
const config = require('./config.js')
|
2018-11-10 17:33:44 +01:00
|
|
|
|
2018-11-07 12:24:53 +01:00
|
|
|
module.exports = {
|
|
|
|
siteMetadata: {
|
2018-11-10 16:48:28 +01:00
|
|
|
// spread all of our config values here
|
|
|
|
// so they can easily be queried with GraphQL
|
|
|
|
...config
|
2018-11-07 12:24:53 +01:00
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-filesystem',
|
|
|
|
options: {
|
|
|
|
name: 'images',
|
|
|
|
path: `${__dirname}/src/images`
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-filesystem',
|
|
|
|
options: {
|
|
|
|
name: 'content',
|
|
|
|
path: `${__dirname}/content`
|
|
|
|
}
|
|
|
|
},
|
2018-11-08 14:49:09 +01:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-filesystem',
|
|
|
|
options: {
|
|
|
|
name: 'data',
|
2018-11-08 14:53:46 +01:00
|
|
|
path: `${__dirname}/data`
|
2018-11-08 14:49:09 +01:00
|
|
|
}
|
|
|
|
},
|
2018-11-09 20:23:24 +01:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-filesystem',
|
|
|
|
options: {
|
|
|
|
name: 'art',
|
|
|
|
path: `${__dirname}/node_modules/@oceanprotocol/art`
|
|
|
|
}
|
|
|
|
},
|
2018-11-14 15:17:19 +01:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-filesystem',
|
|
|
|
options: {
|
|
|
|
name: 'dev-ocean',
|
|
|
|
path: `${__dirname}/external/dev-ocean/doc`
|
|
|
|
}
|
|
|
|
},
|
2018-11-10 17:33:44 +01:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-graphql',
|
|
|
|
options: {
|
|
|
|
typeName: 'GitHub',
|
|
|
|
fieldName: 'github',
|
|
|
|
url: 'https://api.github.com/graphql',
|
|
|
|
headers: {
|
|
|
|
Authorization: `bearer ${process.env.GITHUB_TOKEN}`
|
|
|
|
},
|
|
|
|
// Additional options to pass to node-fetch
|
|
|
|
fetchOptions: {},
|
2018-11-10 18:21:57 +01:00
|
|
|
refetchInterval: 300 // 5 min.
|
2018-11-10 17:33:44 +01:00
|
|
|
}
|
|
|
|
},
|
2018-11-07 16:13:20 +01:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-transformer-remark',
|
|
|
|
options: {
|
|
|
|
plugins: [
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-remark-images',
|
|
|
|
options: {
|
2018-11-10 01:08:20 +01:00
|
|
|
maxWidth: 666,
|
2018-11-08 13:21:39 +01:00
|
|
|
quality: 80,
|
|
|
|
withWebp: true,
|
2018-11-22 23:07:48 +01:00
|
|
|
linkImagesToOriginal: true,
|
2018-11-16 18:17:29 +01:00
|
|
|
showCaptions: true,
|
|
|
|
sizeByPixelDensity: true
|
2018-11-07 16:13:20 +01:00
|
|
|
}
|
|
|
|
},
|
2018-11-12 20:21:12 +01:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-remark-github',
|
|
|
|
options: {
|
|
|
|
marker: 'GITHUB-EMBED',
|
|
|
|
insertEllipsisComments: true,
|
|
|
|
ellipsisPhrase: '...',
|
|
|
|
useCache: true,
|
|
|
|
cacheKey: 'gatsby-remark-github-v1',
|
|
|
|
token: process.env.GITHUB_TOKEN
|
|
|
|
}
|
|
|
|
},
|
2018-11-08 13:21:39 +01:00
|
|
|
'gatsby-remark-smartypants',
|
2018-11-10 00:16:41 +01:00
|
|
|
'gatsby-remark-embed-video',
|
|
|
|
'gatsby-remark-responsive-iframe',
|
2018-11-07 16:13:20 +01:00
|
|
|
'gatsby-remark-prismjs',
|
2018-11-10 00:16:41 +01:00
|
|
|
'gatsby-remark-autolink-headers',
|
2018-11-11 01:32:05 +01:00
|
|
|
'gatsby-remark-copy-linked-files',
|
2018-11-12 13:35:38 +01:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-remark-component',
|
|
|
|
options: {
|
|
|
|
components: ['repo']
|
|
|
|
}
|
|
|
|
}
|
2018-11-07 16:13:20 +01:00
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
2018-11-08 10:44:46 +01:00
|
|
|
'gatsby-transformer-yaml',
|
2018-11-07 16:13:20 +01:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-plugin-sass',
|
|
|
|
options: {
|
2018-11-09 13:57:11 +01:00
|
|
|
includePaths: [
|
|
|
|
`${__dirname}/node_modules`,
|
|
|
|
`${__dirname}/src/styles`
|
|
|
|
]
|
2018-11-07 16:13:20 +01:00
|
|
|
}
|
|
|
|
},
|
2018-11-09 21:39:56 +01:00
|
|
|
'gatsby-transformer-sharp',
|
|
|
|
'gatsby-plugin-sharp',
|
2018-11-07 17:00:54 +01:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-plugin-svgr',
|
|
|
|
options: {
|
|
|
|
icon: true,
|
|
|
|
viewBox: false
|
|
|
|
// see https://github.com/smooth-code/svgr for a list of all options
|
|
|
|
}
|
|
|
|
},
|
2018-11-07 16:13:20 +01:00
|
|
|
'gatsby-plugin-catch-links',
|
2018-11-07 12:24:53 +01:00
|
|
|
'gatsby-plugin-react-helmet',
|
2018-11-29 10:59:38 +01:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-plugin-sitemap',
|
|
|
|
options: {
|
2018-11-30 16:28:44 +01:00
|
|
|
exclude: ['/test/', '/references/petstore/']
|
2018-11-29 10:59:38 +01:00
|
|
|
}
|
|
|
|
},
|
2018-11-09 21:39:56 +01:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-plugin-manifest',
|
|
|
|
options: {
|
2018-11-10 16:48:28 +01:00
|
|
|
name: config.siteTitle,
|
|
|
|
short_name: config.siteShortTitle,
|
|
|
|
description: config.siteDescription,
|
2018-11-09 21:39:56 +01:00
|
|
|
start_url: '/',
|
|
|
|
background_color: '#e2e2e2',
|
|
|
|
theme_color: '#141414',
|
|
|
|
display: 'minimal-ui',
|
2018-11-10 16:48:28 +01:00
|
|
|
icon: config.siteIcon
|
2018-11-09 21:39:56 +01:00
|
|
|
}
|
|
|
|
},
|
2018-11-09 22:59:22 +01:00
|
|
|
'gatsby-plugin-offline',
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-plugin-google-analytics',
|
|
|
|
options: {
|
|
|
|
trackingId: config.analyticsId,
|
|
|
|
head: false,
|
|
|
|
anonymize: true,
|
|
|
|
respectDNT: true,
|
|
|
|
cookieDomain: 'oceanprotocol.com'
|
|
|
|
}
|
|
|
|
}
|
2018-11-07 12:24:53 +01:00
|
|
|
]
|
|
|
|
}
|