Gatsby Theme Docs

 Content Structure

The structure of the content is important when using Gatsby Theme Docbar. Currently there are two requirements:

  1. Provide a Yaml file that will decide that structure and content of the sidebar
  2. Provide a path value in the frontmatter of your Markdown files

Providing a Yaml file

As mentioned above you need to provide a Yaml file that will be used to both determine the structure of the docs, and create pages for those docs. You need to ensure the Yaml file is added to whereever your contentPath value is set.

If you haven't changed the contentPath value, then the default will be a content directory at the root of your site.

The Yaml file needs to be of the following structure:

- title: Heading Without Children Name
  link: link/to/where/you/want/doc/hosted

This allows you to provide a title in the sidebar that links directly to a provided page. Alternatively you can have a title nest children under it:

- title: Heading With Children
  items: 
    - title: Subheading Name
      link: link/to/where/you/want/doc/hosted

In the above case, the Heading With Children becomes a collapsible element hiding the nested items. You can see this in the sidebar on the left if you click on Styling for example.

Updating Markdown

Within each of your provided Markdown files you need to tell Gatsby Theme Docbar where it's corresponding page is:

---
path: "/must/match/value/in/yaml/file"
---

This provided path must match the corresponding document entry in the Yaml file you provided.