1
0
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:
mihaisc 2020-11-12 17:37:49 +02:00 committed by GitHub
parent 149f840741
commit 848949d4ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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) => { ).then(async (result) => {
@ -130,6 +155,15 @@ exports.createPages = ({ graphql, actions }) => {
// API: brizo, aquarius // API: brizo, aquarius
await createSwaggerPages(createPage) 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 // 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 // Swagger Pet Store example
const petStoreSlug = '/references/petstore/' const petStoreSlug = '/references/petstore/'