mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
more generic typedoc files inclusion
This commit is contained in:
parent
6bf055fea7
commit
1f427aa3fe
@ -200,26 +200,38 @@ exports.createPages = ({ graphql, actions }) => {
|
|||||||
//
|
//
|
||||||
// Create pages from TypeDoc json files
|
// Create pages from TypeDoc json files
|
||||||
//
|
//
|
||||||
|
const typeDocSpecs = ['./data/squid-js.json']
|
||||||
const typedocTemplate = path.resolve(
|
const typedocTemplate = path.resolve(
|
||||||
'./src/templates/Typedoc.jsx'
|
'./src/templates/Typedoc.jsx'
|
||||||
)
|
)
|
||||||
|
|
||||||
const squidJsSpecs = require('./data/squid-js.json')
|
typeDocSpecs.forEach(spec => {
|
||||||
const squidJsSlug = '/references/squid-js/'
|
const typedoc = require(spec) // eslint-disable-line
|
||||||
|
|
||||||
createPage({
|
const name = path
|
||||||
path: squidJsSlug,
|
.basename(spec)
|
||||||
component: typedocTemplate,
|
.split('.json')
|
||||||
context: {
|
.join('')
|
||||||
slug: squidJsSlug,
|
|
||||||
typedoc: squidJsSpecs,
|
const slug = `/references/${name}/`
|
||||||
classes: [
|
|
||||||
'ocean/Ocean',
|
createPage({
|
||||||
'ocean/Account',
|
path: slug,
|
||||||
'ddo/DDO',
|
component: typedocTemplate,
|
||||||
'ddo/Service'
|
context: {
|
||||||
]
|
slug,
|
||||||
}
|
typedoc,
|
||||||
|
// TODO: defining these classes for inclusion
|
||||||
|
// needs to be handled somewhere else to keep
|
||||||
|
// it generic for all TypeDoc specs
|
||||||
|
classes: [
|
||||||
|
'ocean/Ocean',
|
||||||
|
'ocean/Account',
|
||||||
|
'ddo/DDO',
|
||||||
|
'ddo/Service'
|
||||||
|
]
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user