docs/gatsby-config.js

177 lines
4.3 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
2018-11-10 21:08:10 +01:00
\nhttps://github.com/oceanprotocol/docs.`
)
2018-11-10 21:08:10 +01:00
}
2018-11-10 15:12:41 +01:00
const config = require('./config.js')
2018-11-07 12:24:53 +01:00
module.exports = {
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
},
{
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}`
},
// 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: {
maxWidth: 666,
quality: 80,
withWebp: true,
linkImagesToOriginal: false,
showCaptions: true
2018-11-07 17:00:54 +01:00
}
},
{
resolve: 'gatsby-remark-github',
options: {
marker: 'GITHUB-EMBED',
insertEllipsisComments: false,
ellipsisPhrase: '...',
useCache: false,
cacheKey: 'gatsby-remark-github-v1',
token: process.env.GITHUB_TOKEN
}
},
'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: {
theme: 'Quiet Light',
injectStyles: false,
languageAliases: {
text: 'log'
}
2018-11-09 21:39:56 +01:00
}
},
{
resolve: 'gatsby-remark-component',
2018-11-09 22:59:22 +01:00
options: {
components: ['repo']
2018-11-09 22:59:22 +01: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`]
}
}
},
'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',
{
resolve: `gatsby-source-git`,
options: {
name: 'repo-read-the-docs',
remote: `https://github.com/oceanprotocol/readthedocs.git`,
2022-02-24 20:04:19 +01:00
local: 'read-the-docs',
2022-02-23 17:16:21 +01:00
branch: 'v4',
patterns: [
'markdowns/ocean-py',
'markdowns/aquarius',
'markdowns/provider'
]
2021-04-12 11:19:11 +02:00
}
},
2021-04-10 17:08:14 +02:00
{
2021-04-12 11:19:11 +02:00
resolve: 'gatsby-source-filesystem',
2021-04-10 17:08:14 +02:00
options: {
2022-02-24 20:04:19 +01:00
path: `${__dirname}/read-the-docs/markdowns`,
2021-04-12 11:19:11 +02:00
name: 'markdowns'
}
2021-09-13 00:50:18 +02:00
},
`gatsby-transformer-remark-plaintext`
]
2018-11-07 12:24:53 +01:00
}