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

setup gatsby-source-openapi-aggregate

This commit is contained in:
Matthias Kretschmann 2018-11-27 15:39:00 +01:00
parent a6e056b856
commit 0fa9eeaf96
Signed by: m
GPG Key ID: 606EEEF3C479A91F
2 changed files with 38 additions and 0 deletions

View File

@ -9,6 +9,22 @@ if (!process.env.GITHUB_TOKEN) {
const config = require('./config.js')
const fs = require('fs')
const path = require('path')
const fromJson = filePath => {
return new Promise((resolve, reject) => {
fs.readFile(filePath, 'utf8', (err, data) => { // eslint-disable-line
if (err) {
reject(err)
return
}
resolve(data)
})
})
}
module.exports = {
siteMetadata: {
// spread all of our config values here
@ -106,6 +122,27 @@ module.exports = {
]
}
},
{
resolve: 'gatsby-source-openapi-aggregate',
options: {
specs: [
{
name: 'aquarius',
resolve: () =>
fromJson(
path.resolve(__dirname, './data/aquarius.json')
)
},
{
name: 'brizo',
resolve: () =>
fromJson(
path.resolve(__dirname, './data/brizo.json')
)
}
]
}
},
'gatsby-transformer-yaml',
{
resolve: 'gatsby-plugin-sass',

View File

@ -47,6 +47,7 @@
"gatsby-remark-smartypants": "^2.0.6",
"gatsby-source-filesystem": "^2.0.9",
"gatsby-source-graphql": "^2.0.6",
"gatsby-source-openapi-aggregate": "^0.1.8",
"gatsby-transformer-remark": "^2.1.12",
"gatsby-transformer-sharp": "^2.1.8",
"gatsby-transformer-yaml": "^2.1.5",