Skip to content

Commit

Permalink
feat: 🚸 split sidebars for doc categories
Browse files Browse the repository at this point in the history
Add separate sidebars for each category of documentation (reference/tutorials/FAQ)
  • Loading branch information
fergcb committed Sep 20, 2023
1 parent be2c0b7 commit cff9732
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 23 deletions.
8 changes: 6 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,19 @@ const config = {
type: "doc",
docId: "introduction",
position: "left",
label: "Get Started",
label: "Docs",
},
{
type: "doc",
docId: "tutorials/index",
position: "left",
label: "Tutorials",
},
{ to: "/api", label: "API", position: "left" },
{
to: "/api",
position: "left",
label: "API",
},
{
type: "doc",
docId: "faq",
Expand Down
52 changes: 31 additions & 21 deletions sidebars.js
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
/**
* Creating a sidebar enables you to:
- create an ordered group of docs
- render a sidebar for each doc of that group
- provide next/previous navigation
The sidebars can be generated from the filesystem, or explicitly defined here.
Create as many sidebars as you want.
*/

// @ts-check

/** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */
const sidebars = {
// By default, Docusaurus generates a sidebar from the docs folder structure
tutorialSidebar: [{ type: "autogenerated", dirName: "." }],

// But you can create a sidebar manually
/*
tutorialSidebar: [
referenceSidebar: [
'introduction',
'tutorials/index',
{
type: 'category',
label: 'Tutorial',
items: ['hello'],
label: 'Reference',
items: [
{ type: 'autogenerated', dirName: 'reference' }
]
},
],
*/
tutorialsSidebar: [
'tutorials/index',
{
type: 'category',
label: 'Beginner',
items: [
{ type: 'autogenerated', dirName: 'tutorials/beginner' }
]
},
{
type: 'category',
label: 'Basic',
items: [
{ type: 'autogenerated', dirName: 'tutorials/basic' }
]
},
{
type: 'category',
label: 'Advanced',
items: [
{ type: 'autogenerated', dirName: 'tutorials/advanced' }
]
}
]
};

module.exports = sidebars;

0 comments on commit cff9732

Please sign in to comment.