1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-11-26 19:49:26 +01:00
docs/gatsby-config.js

158 lines
4.9 KiB
JavaScript
Raw Normal View History

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-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
}
},
{
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`
}
},
{
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: {},
refetchInterval: 300 // 5 min.
}
},
{
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,
linkImagesToOriginal: false,
2018-11-16 18:17:29 +01:00
showCaptions: true,
sizeByPixelDensity: true
}
},
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',
'gatsby-remark-embed-video',
'gatsby-remark-responsive-iframe',
'gatsby-remark-prismjs',
'gatsby-remark-autolink-headers',
2018-11-11 01:32:05 +01:00
'gatsby-remark-copy-linked-files',
{
resolve: 'gatsby-remark-component',
options: {
components: ['repo']
}
}
]
}
},
2018-11-08 10:44:46 +01:00
'gatsby-transformer-yaml',
{
resolve: 'gatsby-plugin-sass',
options: {
2018-11-09 13:57:11 +01:00
includePaths: [
`${__dirname}/node_modules`,
`${__dirname}/src/styles`
]
}
},
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
}
},
'gatsby-plugin-catch-links',
2018-11-07 12:24:53 +01:00
'gatsby-plugin-react-helmet',
2018-11-09 22:59:22 +01:00
'gatsby-plugin-sitemap',
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
]
}