2018-11-11 01:32:05 +01:00
|
|
|
require('dotenv').config()
|
2018-11-10 21:08:10 +01:00
|
|
|
|
|
|
|
if (!process.env.GITHUB_TOKEN) {
|
2020-07-01 11:24:21 +02:00
|
|
|
throw new Error(
|
|
|
|
`A GitHub token is required to build the site. Check the README
|
2018-11-10 21:08:10 +01:00
|
|
|
\nhttps://github.com/oceanprotocol/docs.`
|
2020-07-01 11:24:21 +02:00
|
|
|
)
|
2018-11-10 21:08:10 +01:00
|
|
|
}
|
|
|
|
|
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 = {
|
2020-07-01 11:24:21 +02:00
|
|
|
siteMetadata: {
|
|
|
|
// spread all of our config values here
|
|
|
|
// so they can easily be queried with GraphQL
|
|
|
|
...config
|
|
|
|
},
|
|
|
|
plugins: [
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-filesystem',
|
|
|
|
options: {
|
|
|
|
name: 'images',
|
|
|
|
path: `${__dirname}/src/images`
|
|
|
|
}
|
2018-11-07 12:24:53 +01:00
|
|
|
},
|
2020-07-01 11:24:21 +02:00
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-filesystem',
|
|
|
|
options: {
|
|
|
|
name: 'content',
|
|
|
|
path: `${__dirname}/content`
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-filesystem',
|
|
|
|
options: {
|
|
|
|
name: 'data',
|
|
|
|
path: `${__dirname}/data`
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-filesystem',
|
|
|
|
options: {
|
|
|
|
name: 'art',
|
|
|
|
path: `${__dirname}/node_modules/@oceanprotocol/art`
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-source-graphql',
|
|
|
|
options: {
|
|
|
|
typeName: 'GitHub',
|
|
|
|
fieldName: 'github',
|
|
|
|
url: 'https://api.github.com/graphql',
|
|
|
|
headers: {
|
|
|
|
Authorization: `bearer ${process.env.GITHUB_TOKEN}`
|
2018-11-07 16:13:20 +01:00
|
|
|
},
|
2020-07-01 11:24:21 +02:00
|
|
|
// Additional options to pass to node-fetch
|
|
|
|
fetchOptions: {},
|
|
|
|
refetchInterval: 300 // 5 min.
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-transformer-remark',
|
|
|
|
options: {
|
|
|
|
plugins: [
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-remark-images',
|
2018-11-07 17:00:54 +01:00
|
|
|
options: {
|
2020-07-01 11:24:21 +02:00
|
|
|
maxWidth: 666,
|
|
|
|
quality: 80,
|
|
|
|
withWebp: true,
|
|
|
|
linkImagesToOriginal: false,
|
|
|
|
showCaptions: true
|
2018-11-07 17:00:54 +01:00
|
|
|
}
|
2020-07-01 11:24:21 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-remark-github',
|
2018-11-29 10:59:38 +01:00
|
|
|
options: {
|
2020-07-01 11:24:21 +02:00
|
|
|
marker: 'GITHUB-EMBED',
|
|
|
|
insertEllipsisComments: false,
|
|
|
|
ellipsisPhrase: '...',
|
|
|
|
useCache: false,
|
|
|
|
cacheKey: 'gatsby-remark-github-v1',
|
|
|
|
token: process.env.GITHUB_TOKEN
|
2018-11-29 10:59:38 +01:00
|
|
|
}
|
2020-07-01 11:24:21 +02:00
|
|
|
},
|
|
|
|
'gatsby-remark-smartypants',
|
|
|
|
'gatsby-remark-embed-video',
|
|
|
|
'gatsby-remark-responsive-iframe',
|
|
|
|
'gatsby-remark-autolink-headers',
|
|
|
|
'gatsby-remark-code-titles',
|
|
|
|
{
|
|
|
|
// https://github.com/andrewbranch/gatsby-remark-vscode
|
|
|
|
resolve: 'gatsby-remark-vscode',
|
2018-11-09 21:39:56 +01:00
|
|
|
options: {
|
2020-07-01 11:24:21 +02:00
|
|
|
theme: 'Quiet Light',
|
|
|
|
injectStyles: false,
|
|
|
|
languageAliases: {
|
|
|
|
text: 'log'
|
|
|
|
}
|
2018-11-09 21:39:56 +01:00
|
|
|
}
|
2020-07-01 11:24:21 +02:00
|
|
|
},
|
|
|
|
'gatsby-remark-copy-linked-files',
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-remark-component',
|
2018-11-09 22:59:22 +01:00
|
|
|
options: {
|
2020-07-01 11:24:21 +02:00
|
|
|
components: ['repo']
|
2018-11-09 22:59:22 +01:00
|
|
|
}
|
2020-07-01 11:24:21 +02:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'gatsby-transformer-yaml',
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-plugin-sass',
|
|
|
|
options: {
|
2021-01-13 09:07:00 +01:00
|
|
|
sassOptions: {
|
|
|
|
includePaths: [`${__dirname}/node_modules`, `${__dirname}/src/styles`]
|
|
|
|
}
|
2020-07-01 11:24:21 +02:00
|
|
|
}
|
|
|
|
},
|
|
|
|
'gatsby-transformer-sharp',
|
|
|
|
'gatsby-plugin-sharp',
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-plugin-svgr',
|
|
|
|
options: {
|
|
|
|
icon: true,
|
|
|
|
viewBox: false
|
|
|
|
// see https://github.com/smooth-code/svgr for a list of all options
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'gatsby-plugin-catch-links',
|
|
|
|
'gatsby-plugin-react-helmet',
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-plugin-sitemap',
|
|
|
|
options: {
|
|
|
|
exclude: ['/test', '/references/petstore']
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
resolve: 'gatsby-plugin-manifest',
|
|
|
|
options: {
|
|
|
|
name: config.siteTitle,
|
|
|
|
short_name: config.siteShortTitle,
|
|
|
|
description: config.siteDescription,
|
|
|
|
start_url: '/',
|
|
|
|
background_color: '#e2e2e2',
|
|
|
|
theme_color: '#141414',
|
|
|
|
display: 'minimal-ui',
|
|
|
|
icon: config.siteIcon
|
|
|
|
}
|
|
|
|
},
|
|
|
|
'gatsby-plugin-webpack-size',
|
2021-04-10 17:08:14 +02:00
|
|
|
'gatsby-plugin-offline',
|
2021-04-10 18:11:58 +02:00
|
|
|
{
|
|
|
|
resolve: `gatsby-source-git`,
|
|
|
|
options: {
|
|
|
|
name: `repo-read-the-docs`,
|
|
|
|
remote: `https://github.com/oceanprotocol/readthedocs.git`,
|
|
|
|
local: 'markdowns/',
|
|
|
|
branch: `gatsby`,
|
|
|
|
patterns: `markdowns/**`
|
|
|
|
}
|
|
|
|
},
|
2021-04-10 17:08:14 +02:00
|
|
|
{
|
|
|
|
resolve: `gatsby-source-filesystem`,
|
|
|
|
options: {
|
2021-04-10 18:11:58 +02:00
|
|
|
path: `${__dirname}/markdowns/markdowns`,
|
2021-04-10 17:08:14 +02:00
|
|
|
name: `markdowns`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
`gatsby-transformer-remark`,
|
2020-07-01 11:24:21 +02:00
|
|
|
]
|
2018-11-07 12:24:53 +01:00
|
|
|
}
|