Community Plugin
View plugin on GitHubgatsby-theme-kb
A Gatsby theme for publishing Knowledge Base.
See the demo and documentation.
Setup in your Gatsby project
- Install dependency
yarn add gatsby-theme-kb
- Add these to your gatsby-config.js file:
module.exports = {
plugins: [
{
resolve: `gatsby-theme-kb`,
options: {
contentPath: path.resolve(__dirname, 'content'),
rootNote: 'readme',
getPluginMdx(defaultPluginMdx) {
// customise pre-configured `gatsby-plugin-mdx`, for example:
// defaultPluginMdx.options.gatsbyRemarkPlugins.push({
// resolve: 'gatsby-remark-prismjs',
// })
return defaultPluginMdx
},
},
},
],
};
- Add notes to your site by adding
md
ormdx
files incontent
directory, especially you need acontent/readme.md
file if you are using above configs. - Start developing your site by running
gatsby develop
. If you are using above configuration, your start url will be ’http://localhost:8000’.
Usage
Options
Key | Default value | Description |
---|---|---|
rootNote | /readme |
Root note’s name (without exts) |
contentPath | Location of local content | |
extensions | [‘.md’, ‘.mdx’] | Valid content file exts |
ignore | ['.git'] |
A list of file globs to ignore |
getPluginMdx | (defaultPluginMdx) => PluginMdx | Customise pre-configured gatsby-plugin-mdx , please do always return a valid gatsby plugin object |