mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
grab all files with required markdown defined
This commit is contained in:
parent
a36e73163c
commit
27419687e1
@ -57,7 +57,7 @@ exports.createPages = ({ graphql, actions }) => {
|
|||||||
architectureDocs: allMarkdownRemark(
|
architectureDocs: allMarkdownRemark(
|
||||||
filter: {
|
filter: {
|
||||||
fileAbsolutePath: {
|
fileAbsolutePath: {
|
||||||
regex: "/dev-ocean/doc/architecture.md/"
|
regex: "/dev-ocean/doc/architecture/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
@ -67,6 +67,12 @@ exports.createPages = ({ graphql, actions }) => {
|
|||||||
slug
|
slug
|
||||||
section
|
section
|
||||||
}
|
}
|
||||||
|
frontmatter {
|
||||||
|
slug
|
||||||
|
title
|
||||||
|
description
|
||||||
|
section
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -97,53 +103,25 @@ exports.createPages = ({ graphql, actions }) => {
|
|||||||
// Create Architecture section from dev-ocean contents
|
// Create Architecture section from dev-ocean contents
|
||||||
const postsArchitecture = result.data.architectureDocs.edges
|
const postsArchitecture = result.data.architectureDocs.edges
|
||||||
|
|
||||||
postsArchitecture.forEach(post => {
|
postsArchitecture
|
||||||
createPage({
|
// only grab files with required frontmatter defined
|
||||||
path: `${post.node.fields.slug}`,
|
.filter(
|
||||||
component: docTemplate,
|
post =>
|
||||||
context: {
|
post.node.frontmatter.slug &&
|
||||||
slug: post.node.fields.slug,
|
post.node.frontmatter.title &&
|
||||||
section: post.node.fields.section
|
post.node.frontmatter.description &&
|
||||||
}
|
post.node.frontmatter.section
|
||||||
|
)
|
||||||
|
.forEach(post => {
|
||||||
|
createPage({
|
||||||
|
path: `${post.node.fields.slug}`,
|
||||||
|
component: docTemplate,
|
||||||
|
context: {
|
||||||
|
slug: post.node.fields.slug,
|
||||||
|
section: post.node.fields.section
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
|
|
||||||
// createPage({
|
|
||||||
// path: '/concepts/architecture/',
|
|
||||||
// component: docTemplate,
|
|
||||||
// context: {
|
|
||||||
// slug: post.node.fields.slug,
|
|
||||||
// section: post.node.fields.section
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
// const docRepoTemplate = path.resolve(
|
|
||||||
// './src/templates/DocRepo.jsx'
|
|
||||||
// )
|
|
||||||
|
|
||||||
// createPage({
|
|
||||||
// path: '/concepts/architecture/',
|
|
||||||
// component: docRepoTemplate,
|
|
||||||
// context: {
|
|
||||||
// slug: '/concepts/architecture/',
|
|
||||||
// section: 'concepts',
|
|
||||||
// title: 'Architecture',
|
|
||||||
// description: 'Hello description',
|
|
||||||
// content: `${result.data.github.repository.root.text}`
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
// createPage({
|
|
||||||
// path: '/concepts/squid/',
|
|
||||||
// component: docRepoTemplate,
|
|
||||||
// context: {
|
|
||||||
// slug: '/concepts/squid/',
|
|
||||||
// section: 'concepts',
|
|
||||||
// title: 'Squid',
|
|
||||||
// description: 'Hello description',
|
|
||||||
// content: `${result.data.github.repository.squid.text}`
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
resolve()
|
resolve()
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user