-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit d4021bc
Showing
38 changed files
with
8,221 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@changesets/cli/changelog", | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "main", | ||
"updateInternalDependencies": "patch", | ||
"ignore": ["docs"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "npm" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "daily" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
concurrency: ${{ github.workflow }}-${{ github.ref }} | ||
|
||
jobs: | ||
release: | ||
name: Release | ||
if: ${{ github.repository_owner == 'lorenzolewis' }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v3 | ||
|
||
- name: Install Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
cache: pnpm | ||
node-version: 18 | ||
|
||
- name: Install dependencies | ||
run: pnpm install | ||
|
||
- name: Create Release Pull Request | ||
uses: changesets/action@v1 | ||
with: | ||
version: pnpm run version | ||
publish: pnpm changeset publish | ||
commit: "[ci] release" | ||
title: "[ci] release" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# build output | ||
dist/ | ||
# generated types | ||
.astro/ | ||
|
||
# dependencies | ||
node_modules/ | ||
|
||
# logs | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
|
||
|
||
# environment variables | ||
.env | ||
.env.production | ||
|
||
# macOS-specific files | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"recommendations": ["astro-build.astro-vscode"], | ||
"unwantedRecommendations": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"command": "./node_modules/.bin/astro dev", | ||
"name": "Development server", | ||
"request": "launch", | ||
"type": "node-terminal" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"cSpell.enableFiletypes": ["mdx"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# 🗄️ Starlight Multi-Sidebar | ||
|
||
Have multiple sidebars in your Starlight site! | ||
|
||
Visit the documentation for instructions on how to use: https://starlight-multi-sidebar.pages.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
# Starlight Starter Kit: Basics | ||
|
||
[](https://starlight.astro.build) | ||
|
||
``` | ||
npm create astro@latest -- --template starlight | ||
``` | ||
|
||
[](https://stackblitz.com/github/withastro/starlight/tree/main/examples/basics) | ||
[](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/basics) | ||
[](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Fbasics&project-name=my-starlight-docs&repository-name=my-starlight-docs) | ||
|
||
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun! | ||
## 🚀 Project Structure | ||
|
||
Inside of your Astro + Starlight project, you'll see the following folders and files: | ||
|
||
``` | ||
. | ||
├── public/ | ||
├── src/ | ||
│ ├── assets/ | ||
│ ├── content/ | ||
│ │ ├── docs/ | ||
│ │ └── config.ts | ||
│ └── env.d.ts | ||
├── astro.config.mjs | ||
├── package.json | ||
└── tsconfig.json | ||
``` | ||
|
||
Starlight looks for `.md` or `.mdx` files in the `src/content/docs/` directory. Each file is exposed as a route based on its file name. | ||
|
||
Images can be added to `src/assets/` and embedded in Markdown with a relative link. | ||
|
||
Static assets, like favicons, can be placed in the `public/` directory. | ||
|
||
## 🧞 Commands | ||
|
||
All commands are run from the root of the project, from a terminal: | ||
|
||
| Command | Action | | ||
| :------------------------ | :----------------------------------------------- | | ||
| `npm install` | Installs dependencies | | ||
| `npm run dev` | Starts local dev server at `localhost:4321` | | ||
| `npm run build` | Build your production site to `./dist/` | | ||
| `npm run preview` | Preview your build locally, before deploying | | ||
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` | | ||
| `npm run astro -- --help` | Get help using the Astro CLI | | ||
|
||
## 👀 Want to learn more? | ||
|
||
Check out [Starlight’s docs](https://starlight.astro.build/), read [the Astro documentation](https://docs.astro.build), or jump into the [Astro Discord server](https://astro.build/chat). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { defineConfig } from "astro/config"; | ||
import starlight from "@astrojs/starlight"; | ||
import starlightMultiSidebar from "@lorenzo_lewis/starlight-nav"; | ||
import starlightLinksValidatorPlugin from "starlight-links-validator"; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
site: "https://starlight-nav.pages.dev", | ||
integrations: [ | ||
starlight({ | ||
title: "🗄️ Starlight Multi-Sidebar", | ||
social: { | ||
github: "https://github.com/lorenzolewis/starlight-multi-sidebar", | ||
}, | ||
sidebar: [ | ||
{ | ||
label: "Docs", | ||
autogenerate: { directory: "docs" }, | ||
}, | ||
{ | ||
label: "Samples", | ||
autogenerate: { directory: "sample" }, | ||
badge: "Demo", | ||
}, | ||
], | ||
plugins: [ | ||
starlightMultiSidebar({ switcherStyle: "horizontalList" }), | ||
starlightLinksValidatorPlugin(), | ||
], | ||
}), | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "docs", | ||
"private": true, | ||
"type": "module", | ||
"version": "0.0.1", | ||
"scripts": { | ||
"dev": "astro dev", | ||
"start": "astro dev", | ||
"build": "astro check && astro build", | ||
"preview": "astro preview", | ||
"astro": "astro" | ||
}, | ||
"dependencies": { | ||
"@astrojs/check": "^0.7.0", | ||
"@astrojs/starlight": "^0.23.1", | ||
"@lorenzo_lewis/starlight-multi-sidebar": "workspace:*", | ||
"astro": "^4.8.6", | ||
"sharp": "^0.33.4", | ||
"starlight-links-validator": "^0.8.0", | ||
"starlight-package-managers": "^0.5.0", | ||
"typescript": "^5.4.5" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { defineCollection } from "astro:content"; | ||
import { docsSchema } from "@astrojs/starlight/schema"; | ||
|
||
export const collections = { | ||
docs: defineCollection({ schema: docsSchema() }), | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { Steps } from "@astrojs/starlight/components"; | ||
import { PackageManagers } from "starlight-package-managers"; | ||
|
||
<Steps> | ||
|
||
1. Setup a Starlight Site: https://starlight.astro.build/getting-started/ | ||
|
||
2. Install the `starlight-multi-sidebar` plugin: | ||
|
||
<PackageManagers pkg="@lorenzo_lewis/starlight-multi-sidebar" /> | ||
|
||
3. Update the `integrations.starlight.plugins` object in `astro.config.mjs` to include the `starlight-multi-sidebar` 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"; | ||
|
||
// https://astro.build/config | ||
export default defineConfig({ | ||
integrations: [ | ||
starlight({ | ||
plugins: [starlightMultiSidebar()], | ||
}), | ||
], | ||
}); | ||
``` | ||
|
||
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! ✨ | ||
|
||
</Steps> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
title: Changelog | ||
sidebar: | ||
order: 3 | ||
--- | ||
|
||
import Changelog from "../../../../../packages/starlight-multi-sidebar/CHANGELOG.md"; | ||
|
||
<Changelog /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- | ||
title: Getting Started | ||
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"; | ||
|
||
<Setup /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: 🗄️ Starlight Multi-Sidebar | ||
description: Enable multiple sidebars with your Starlight site. | ||
hero: | ||
tagline: Enable multiple sidebars with your Starlight site. | ||
image: | ||
file: ../../assets/houston.webp | ||
actions: | ||
- text: Get Started | ||
link: /docs/ | ||
icon: right-arrow | ||
variant: primary | ||
--- | ||
|
||
import QuickStart from "./_quick-start.mdx"; | ||
|
||
## Quick Start | ||
|
||
<QuickStart /> |
Oops, something went wrong.