mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
Issue-545: Add content as index
This commit is contained in:
parent
1466fce1cb
commit
eb59b06c46
@ -170,6 +170,7 @@ module.exports = {
|
||||
path: `${__dirname}/markdowns/markdowns`,
|
||||
name: 'markdowns'
|
||||
}
|
||||
}
|
||||
},
|
||||
`gatsby-transformer-remark-plaintext`
|
||||
]
|
||||
}
|
||||
|
14
package-lock.json
generated
14
package-lock.json
generated
@ -14411,6 +14411,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"gatsby-transformer-remark-plaintext": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/gatsby-transformer-remark-plaintext/-/gatsby-transformer-remark-plaintext-1.0.3.tgz",
|
||||
"integrity": "sha512-V6nU03WKW65Xy5DyQPeVSMf5KVNoXX2yHbq53H0u1a/MkakG3osNTDWiTDxVQ8kg9OZ/04Dblczg9QxRnLjrYA==",
|
||||
"requires": {
|
||||
"@babel/runtime": "^7.0.0",
|
||||
"strip-markdown": "^3.0.2"
|
||||
}
|
||||
},
|
||||
"gatsby-transformer-sharp": {
|
||||
"version": "2.12.1",
|
||||
"resolved": "https://registry.npmjs.org/gatsby-transformer-sharp/-/gatsby-transformer-sharp-2.12.1.tgz",
|
||||
@ -23950,6 +23959,11 @@
|
||||
"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz",
|
||||
"integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w=="
|
||||
},
|
||||
"strip-markdown": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/strip-markdown/-/strip-markdown-3.1.2.tgz",
|
||||
"integrity": "sha512-NjwW6CEefesmHQPs7lof/lgnSriqUnRNOWpnrNPq9A7/yOCdnhaB7DcxlhYuN7WiiRUe349aitAsTQ/ajM9Dmw=="
|
||||
},
|
||||
"strip-outer": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/strip-outer/-/strip-outer-1.0.1.tgz",
|
||||
|
@ -45,6 +45,7 @@
|
||||
"gatsby-source-git": "^1.1.0",
|
||||
"gatsby-source-graphql": "^2.14.0",
|
||||
"gatsby-transformer-remark": "^2.16.1",
|
||||
"gatsby-transformer-remark-plaintext": "^1.0.3",
|
||||
"gatsby-transformer-sharp": "^2.12.1",
|
||||
"gatsby-transformer-xml": "^2.10.0",
|
||||
"gatsby-transformer-yaml": "^2.11.0",
|
||||
|
@ -65,6 +65,7 @@ const SearchClient = ({ searchableData }) => {
|
||||
const dataToSearch = new JsSearch.Search('title')
|
||||
dataToSearch.addIndex('title')
|
||||
dataToSearch.addIndex('description')
|
||||
dataToSearch.addIndex('text')
|
||||
|
||||
dataToSearch.addDocuments(searchableData)
|
||||
setSearchState({
|
||||
|
@ -19,18 +19,20 @@ const SearchComponent = () => {
|
||||
description
|
||||
}
|
||||
id
|
||||
plainText
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
`)
|
||||
|
||||
console.log('data', data)
|
||||
const searchableData = data.allMarkdownRemark.edges.map(({ node }) => {
|
||||
return {
|
||||
title: node.frontmatter.title,
|
||||
description: node.frontmatter.description,
|
||||
slug: node.fields.slug,
|
||||
id: node.id
|
||||
id: node.id,
|
||||
text: node.plainText
|
||||
}
|
||||
})
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user