hasura / gatsby-gitbook-starter

Generate GitBook style modern docs/tutorial websites using Gatsby + MDX
https://hasura.io/learn/graphql/react/introduction/
MIT License
984 stars 377 forks source link

Is there a way to set the tree in the left side bar to "expand all" on first view? #111

Closed reselbob closed 3 years ago

reselbob commented 3 years ago

I want to make it so that the first time the side loads the left tree in the sidebar is full expanded.

And then users collapse the nodes as desired.

Thanks in advance for any help you can provide.

reselbob commented 3 years ago

Figured it out. Just omit the all the top level lines for the collapsedNav attribute in config.js like so

  sidebar: {
    forcedNavOrder: [
      '/introduction', // add trailing slash if enabled above
      '/key-concepts',
      '/tutorials',
      '/api',
      '/community',
      '/market-considerations',
      '/glossary',
      '/faqs',
      '/troubleshooting'
    ],
    collapsedNav: [
      //this will expand all nodes
    ],
    links: [{ text: 'mimik', link: 'https://mimik.com' }],
    frontline: false,
    ignoreIndex: true,
    title:
      "Developer Documentation",
  },
reselbob commented 3 years ago

Closing it out