Skip to content

Generating new sidebars and docs sections #11

Description

@jq-11

Summary

How to generate new documentations headers with custom and or automated sidebars

Create a new folder with content

./Testing 
    intro.md

copy the sidebar.js file at the root, rename it appropriatly,

sidebars.js --> testSidebars.js

update the sidebar Id appropriatly (line 18), remove line 21 it is not required

  testSidebar: [{type: 'autogenerated', dirName: '.'}],

Go to your docusaur config

  1. add plugins as follows
  plugins: [
    [
      '@docusaurus/plugin-content-docs',
      {
        id: 'test',
        path: 'Testing',
        routeBasePath: 'Testing',
        sidebarPath: require.resolve('./testSidebars.js'),
      },
    ],
  ],
  1. under themeConfig > navbar add the following to the items array
{to: '/Testing/intro', label: 'Test', position: 'left'},

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions