mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
Update gatsby-node.js
This commit is contained in:
parent
149f840741
commit
848949d4ae
@ -76,6 +76,31 @@ exports.createPages = ({ graphql, actions }) => {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
oceanJs: github {
|
||||
repository(name: "ocean.js", owner: "oceanprotocol") {
|
||||
name
|
||||
releases(
|
||||
first: 30
|
||||
orderBy: { field: CREATED_AT, direction: DESC }
|
||||
) {
|
||||
edges {
|
||||
node {
|
||||
isPrerelease
|
||||
isDraft
|
||||
releaseAssets(first: 1, name: "ocean.js.json") {
|
||||
edges {
|
||||
node {
|
||||
name
|
||||
downloadUrl
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`
|
||||
).then(async (result) => {
|
||||
@ -130,6 +155,15 @@ exports.createPages = ({ graphql, actions }) => {
|
||||
// API: brizo, aquarius
|
||||
await createSwaggerPages(createPage)
|
||||
|
||||
// API: ocean.js
|
||||
const lastRelease = result.data.oceanJs.repository.releases.edges.filter(
|
||||
({ node }) => !node.isPrerelease && !node.isDraft
|
||||
)[0].node.releaseAssets.edges[0].node
|
||||
await createTypeDocPage(
|
||||
createPage,
|
||||
result.data.oceanJs.repository.name,
|
||||
lastRelease.downloadUrl
|
||||
)
|
||||
|
||||
//
|
||||
// create redirects
|
||||
@ -239,6 +273,19 @@ const createSwaggerPages = async (createPage) => {
|
||||
}
|
||||
})
|
||||
|
||||
const specBrizo = await fetchSwaggerSpec(swaggerComponents[1])
|
||||
const slugBrizo = getSlug(swaggerComponents[1])
|
||||
|
||||
createPage({
|
||||
path: slugBrizo,
|
||||
component: apiSwaggerTemplate,
|
||||
context: {
|
||||
slug: slugBrizo,
|
||||
name: swaggerComponents[1],
|
||||
api: specBrizo
|
||||
}
|
||||
})
|
||||
|
||||
// Swagger Pet Store example
|
||||
const petStoreSlug = '/references/petstore/'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user