Skip to content

Commit

Permalink
Merge pull request #70 from lorenzolewis/lorenzolewis-patch-1
Browse files Browse the repository at this point in the history
Update multi-sidebar.mdx
  • Loading branch information
lorenzolewis authored Jul 25, 2024
2 parents f4813eb + 6bcd34e commit 0d58176
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions docs/src/content/docs/utilities/multi-sidebar.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ If migrating from that package read the [Migration Steps](#migration) below.

Multi-sidebar can be enabled by adding the `multiSidebar` object to the Starlight Utils configuration.

```ts {12-14}
To define the sidebars, specify a label and contents for each sidebar. Here is a simplified example of the config used for this site:

```ts {12-14,17-27}
// astro.config.mjs
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
Expand All @@ -44,29 +46,22 @@ export default defineConfig({
},
}),
],
sidebar: [
{
label: "Main",
autogenerate: { directory: "/docs" },
},
{
label: "Demos",
autogenerate: { directory: "/demos" },
badge: "New",
},
],
}),
],
});
```

To define the sidebars, specify a label and contents for each sidebar. Here is a simplified example of the config used for this site:

```ts
// astro.config.mjs
sidebar: [
{
label: 'Main',
autogenerate: { directory: '/docs' },
},
{
label: 'Demos',
autogenerate: { directory: '/demos' },
badge: 'New',
},
],
```


### `multiSidebar`

**Type:** `boolean | { switcherStyle: "dropdown" | "horizontalList" | "hidden" } | undefined`
Expand Down

0 comments on commit 0d58176

Please sign in to comment.