Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzolewis committed May 21, 2024
1 parent d4021bc commit de66589
Show file tree
Hide file tree
Showing 23 changed files with 34 additions and 305 deletions.
5 changes: 0 additions & 5 deletions README.md

This file was deleted.

1 change: 1 addition & 0 deletions README.md
13 changes: 5 additions & 8 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import starlightMultiSidebar from "@lorenzo_lewis/starlight-nav";
import starlightUtils from "@lorenzo_lewis/starlight-utils";
import starlightLinksValidatorPlugin from "starlight-links-validator";

// https://astro.build/config
export default defineConfig({
site: "https://starlight-nav.pages.dev",
site: "https://starlight-utils.pages.dev",
integrations: [
starlight({
title: "πŸ—„οΈ Starlight Multi-Sidebar",
title: "🧰 Starlight Utils",
social: {
github: "https://github.com/lorenzolewis/starlight-multi-sidebar",
github: "https://github.com/lorenzolewis/starlight-utils",
},
sidebar: [
{
Expand All @@ -23,10 +23,7 @@ export default defineConfig({
badge: "Demo",
},
],
plugins: [
starlightMultiSidebar({ switcherStyle: "horizontalList" }),
starlightLinksValidatorPlugin(),
],
plugins: [starlightUtils(), starlightLinksValidatorPlugin()],
}),
],
});
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"dependencies": {
"@astrojs/check": "^0.7.0",
"@astrojs/starlight": "^0.23.1",
"@lorenzo_lewis/starlight-multi-sidebar": "workspace:*",
"@lorenzo_lewis/starlight-utils": "workspace:*",
"astro": "^4.8.6",
"sharp": "^0.33.4",
"starlight-links-validator": "^0.8.0",
Expand Down
40 changes: 6 additions & 34 deletions docs/src/content/docs/_quick-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,28 @@ import { PackageManagers } from "starlight-package-managers";

1. Setup a Starlight Site: https://starlight.astro.build/getting-started/

2. Install the `starlight-multi-sidebar` plugin:
2. Install the `starlight-utils` plugin:

<PackageManagers pkg="@lorenzo_lewis/starlight-multi-sidebar" />
<PackageManagers pkg="@lorenzo_lewis/starlight-utils" />

3. Update the `integrations.starlight.plugins` object in `astro.config.mjs` to include the `starlight-multi-sidebar` plugin:
3. Update the `integrations.starlight.plugins` object in `astro.config.mjs` to include the `starlight-utils` plugin:

```ts ins={4, 10}
// astro.config.mjs
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import starlightMultiSidebar from "@lorenzo_lewis/starlight-multi-sidebar";
import starlightUtils from "@lorenzo_lewis/starlight-utils";

// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
plugins: [starlightMultiSidebar()],
plugins: [starlightUtils()],
}),
],
});
```

4. All top-level items in `integrations.starlight.sidebar` are turned into their own sidebar. Configure each desired sidebar:

```ts ins={11-20}
// astro.config.mjs
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import starlightMultiSidebar from "@lorenzo_lewis/starlight-multi-sidebar";

// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
plugins: [starlightMultiSidebar],
sidebar: [
{
label: "Guides",
autogenerate: { directory: "reference" },
},
{
label: "Reference",
autogenerate: { directory: "reference" },
},
],
}),
],
});
```

5. All done! ✨
4. All done! ✨

</Steps>
2 changes: 1 addition & 1 deletion docs/src/content/docs/docs/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ sidebar:
order: 3
---

import Changelog from "../../../../../packages/starlight-multi-sidebar/CHANGELOG.md";
import Changelog from "../../../../../packages/starlight-utils/CHANGELOG.md";

<Changelog />
30 changes: 0 additions & 30 deletions docs/src/content/docs/docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,3 @@ title: Configuration
sidebar:
order: 2
---

There are a few options that can be passed to `starlight-multi-sidebar`. See below for how to configure each of those options

```ts {11-13}
// astro.config.mjs
import { defineConfig } from "astro/config";
import starlight from "@astrojs/starlight";
import starlightMultiSidebar from "@lorenzo_lewis/starlight-multi-sidebar";

// https://astro.build/config
export default defineConfig({
integrations: [
starlight({
plugins: [
starlightMultiSidebar({
switcherStyle: "horizontalList",
}),
],
}),
],
});
```

## `switcherStyle`

**Type:** `"dropdown" | "horizontalList"`

**Default:** `"horizontalList"`

Specifies which style should be used for the sidebar.
14 changes: 0 additions & 14 deletions docs/src/content/docs/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,6 @@ sidebar:
order: 1
---

:::caution

This package is still in alpha. There are known issues with accessibility that have not been addressed. If any issues are found please [open an issue on GitHub](https://github.com/lorenzolewis/starlight-multi-sidebar/issues).

:::

There are cases where having multiple sidebars for a Starlight site can be useful. [Starlight does not currently support this natively](https://github.com/withastro/starlight/discussions/959), but this Starlight plugin gives a minimal implementation of this.

:::tip

Take a look at the sidebar on this page to see what this looks like!

:::

## Setup Instructions

import Setup from "../_quick-start.mdx";
Expand Down
2 changes: 1 addition & 1 deletion docs/src/content/docs/index.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
title: πŸ—„οΈ Starlight Multi-Sidebar
title: 🧰 Starlight Utils
description: Enable multiple sidebars with your Starlight site.
hero:
tagline: Enable multiple sidebars with your Starlight site.
Expand Down
54 changes: 0 additions & 54 deletions docs/src/content/docs/sample/folder/2.md

This file was deleted.

50 changes: 0 additions & 50 deletions docs/src/content/docs/sample/index.md

This file was deleted.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "starlight-multi-sidebar-monorepo",
"name": "starlight-utils-monorepo",
"type": "module",
"version": "0.0.1",
"license": "MIT",
Expand Down
85 changes: 0 additions & 85 deletions packages/starlight-multi-sidebar/CHANGELOG.md

This file was deleted.

5 changes: 0 additions & 5 deletions packages/starlight-multi-sidebar/README.md

This file was deleted.

Empty file.
5 changes: 5 additions & 0 deletions packages/starlight-utils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# πŸ—„οΈ Starlight Utils

A collection of utilities to build on top of your 🌟 [Starlight](https://starlight.astro.build) site.

Visit the documentation for instructions on how to use: https://starlight-utils.pages.dev
File renamed without changes.
Loading

0 comments on commit de66589

Please sign in to comment.