mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
Issue-#850: Rest api
This commit is contained in:
parent
cee06030d8
commit
b4663c125a
@ -103,6 +103,34 @@ exports.createPages = ({ graphql, actions }) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
aquariusRestApi: allMarkdownRemark(
|
||||||
|
filter: {
|
||||||
|
frontmatter: {
|
||||||
|
title: { eq: "API.md" }
|
||||||
|
app: { eq: "aquarius" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
) {
|
||||||
|
edges {
|
||||||
|
node {
|
||||||
|
id
|
||||||
|
html
|
||||||
|
htmlAst
|
||||||
|
tableOfContents
|
||||||
|
frontmatter {
|
||||||
|
title
|
||||||
|
description
|
||||||
|
slug
|
||||||
|
section
|
||||||
|
app
|
||||||
|
module
|
||||||
|
source
|
||||||
|
version
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
`
|
`
|
||||||
).then(async (result) => {
|
).then(async (result) => {
|
||||||
@ -165,27 +193,24 @@ exports.createPages = ({ graphql, actions }) => {
|
|||||||
const providerList = filterMarkdownList(markdowns, 'provider')
|
const providerList = filterMarkdownList(markdowns, 'provider')
|
||||||
const subgraphList = filterMarkdownList(markdowns, 'ocean-subgraph')
|
const subgraphList = filterMarkdownList(markdowns, 'ocean-subgraph')
|
||||||
|
|
||||||
const aquariusRestApi = getRestApiPageFromMarkdownList(
|
console.log('Aquarius rest api', result.data.aquariusRestApi)
|
||||||
markdowns,
|
const aquariusRestApi = result.data.aquariusRestApi.edges[0].node
|
||||||
'aquarius'
|
|
||||||
)[0].node
|
|
||||||
|
|
||||||
await createRestApiPage(
|
await createRestApiPage(
|
||||||
createPage,
|
createPage,
|
||||||
aquariusRestApi,
|
aquariusRestApi,
|
||||||
`/references/aquarius-rest-api`
|
`/references/aquarius-rest-api`
|
||||||
)
|
)
|
||||||
|
|
||||||
const providerRestApi = getRestApiPageFromMarkdownList(
|
// const providerRestApi = getRestApiPageFromMarkdownList(
|
||||||
markdowns,
|
// markdowns,
|
||||||
'provider'
|
// 'provider'
|
||||||
)[0].node
|
// )[0].node
|
||||||
|
|
||||||
await createRestApiPage(
|
// await createRestApiPage(
|
||||||
createPage,
|
// createPage,
|
||||||
providerRestApi,
|
// providerRestApi,
|
||||||
`/references/provider-rest-api`
|
// `/references/provider-rest-api`
|
||||||
)
|
// )
|
||||||
|
|
||||||
await createReadTheDocsPage(createPage, 'ocean-py', oceanPyList)
|
await createReadTheDocsPage(createPage, 'ocean-py', oceanPyList)
|
||||||
await createReadTheDocsPage(createPage, 'provider', providerList)
|
await createReadTheDocsPage(createPage, 'provider', providerList)
|
||||||
@ -327,9 +352,9 @@ const createRestApiPage = async (createPage, node, slug) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getRestApiPageFromMarkdownList = (markdownList, string) => {
|
// const getRestApiPageFromMarkdownList = (markdownList, string) => {
|
||||||
return markdownList.filter(
|
// return markdownList.filter(
|
||||||
({ node }) =>
|
// ({ node }) =>
|
||||||
node.frontmatter.app === string && node.frontmatter.slug === 'API.md'
|
// node.frontmatter.app === string && node.frontmatter.slug === 'API.md'
|
||||||
)
|
// )
|
||||||
}
|
// }
|
||||||
|
Loading…
Reference in New Issue
Block a user