From 8a5fb2366c40985d334db81b8740ef6b41f4b5e0 Mon Sep 17 00:00:00 2001 From: d3v1l0n Date: Sun, 5 Jan 2025 20:19:28 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=9B=A0=20refactor:=20redundancy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sidebars.ts | 49 ++++++++++++++++++++++++++++++++----------------- 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/sidebars.ts b/sidebars.ts index 28971397..5464d1f4 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -1,33 +1,48 @@ -import type {SidebarsConfig} from '@docusaurus/plugin-content-docs'; - -// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...) +import type { SidebarsConfig } from '@docusaurus/plugin-content-docs'; /** - * 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. + * Sidebars Configuration for Docusaurus Documentation + * + * This configuration enables you to: + * - Automatically generate a sidebar based on the folder structure. + * - Manually define a custom sidebar structure if needed. + * + * You can switch between autogenerated and manual sidebars based on your requirements. */ -const sidebars: SidebarsConfig = { - // By default, Docusaurus generates a sidebar from the docs folder structure - tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], - // But you can create a sidebar manually +const sidebars: SidebarsConfig = { + /** + * Autogenerated Sidebar: + * Automatically generates a sidebar from the file structure in the "docs" directory. + * Useful for projects with a straightforward or hierarchical content layout. + */ + tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }], + + /** + * Example Manual Sidebar (Commented): + * Uncomment the following section if you'd like to define a sidebar manually. + */ /* tutorialSidebar: [ + // Single document reference 'intro', 'hello', + // Category with nested items { type: 'category', label: 'Tutorial', - items: ['tutorial-basics/create-a-document'], + collapsible: true, + collapsed: false, + items: ['tutorial-basics/create-a-document', 'tutorial-basics/deploy-your-site'], + }, + // External link example + { + type: 'link', + label: 'Docusaurus Docs', // Link label + href: 'https://docusaurus.io', // URL }, ], - */ + */ }; export default sidebars;