Skip to content

Commit 4bcf0a6

Browse files
committed
add docs via starlight
1 parent 4436caf commit 4bcf0a6

File tree

12 files changed

+884
-7
lines changed

12 files changed

+884
-7
lines changed

bun.lock

Lines changed: 696 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/docs/.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
5+
6+
# dependencies
7+
node_modules/
8+
9+
# logs
10+
npm-debug.log*
11+
yarn-debug.log*
12+
yarn-error.log*
13+
pnpm-debug.log*
14+
15+
16+
# environment variables
17+
.env
18+
.env.production
19+
20+
# macOS-specific files
21+
.DS_Store

packages/docs/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Starlight Starter Kit: Basics
2+
3+
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
4+
5+
```
6+
bun create astro@latest -- --template starlight
7+
```
8+
9+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
10+
11+
## 🚀 Project Structure
12+
13+
Inside of your Astro + Starlight project, you'll see the following folders and files:
14+
15+
```
16+
.
17+
├── public/
18+
├── src/
19+
│ ├── assets/
20+
│ ├── content/
21+
│ │ └── docs/
22+
│ └── content.config.ts
23+
├── astro.config.mjs
24+
├── package.json
25+
└── tsconfig.json
26+
```
27+
28+
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.
29+
30+
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
31+
32+
Static assets, like favicons, can be placed in the `public/` directory.
33+
34+
## 🧞 Commands
35+
36+
All commands are run from the root of the project, from a terminal:
37+
38+
| Command | Action |
39+
| :------------------------ | :----------------------------------------------- |
40+
| `bun install` | Installs dependencies |
41+
| `bun dev` | Starts local dev server at `localhost:4321` |
42+
| `bun build` | Build your production site to `./dist/` |
43+
| `bun preview` | Preview your build locally, before deploying |
44+
| `bun astro ...` | Run CLI commands like `astro add`, `astro check` |
45+
| `bun astro -- --help` | Get help using the Astro CLI |
46+
47+
## 👀 Want to learn more?
48+
49+
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).

packages/docs/astro.config.mjs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config';
3+
import starlight from '@astrojs/starlight';
4+
5+
// https://astro.build/config
6+
export default defineConfig({
7+
integrations: [
8+
starlight({
9+
title: 'My Docs',
10+
social: [{ icon: 'github', label: 'GitHub', href: 'https://github.com/withastro/starlight' }],
11+
sidebar: [
12+
{
13+
label: 'Guides',
14+
items: [
15+
// Each item here is one entry in the navigation menu.
16+
{ label: 'Example Guide', slug: 'guides/example' },
17+
],
18+
},
19+
{
20+
label: 'Reference',
21+
autogenerate: { directory: 'reference' },
22+
},
23+
],
24+
}),
25+
],
26+
});

packages/docs/package.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "docs",
3+
"type": "module",
4+
"version": "0.0.1",
5+
"scripts": {
6+
"dev": "astro dev",
7+
"start": "astro dev",
8+
"build": "astro build",
9+
"preview": "astro preview",
10+
"astro": "astro"
11+
},
12+
"dependencies": {
13+
"@astrojs/starlight": "^0.37.1",
14+
"astro": "^5.6.1",
15+
"sharp": "^0.34.2"
16+
}
17+
}

packages/docs/public/favicon.svg

Lines changed: 1 addition & 0 deletions
Loading
96.2 KB
Loading
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { defineCollection } from 'astro:content';
2+
import { docsLoader } from '@astrojs/starlight/loaders';
3+
import { docsSchema } from '@astrojs/starlight/schema';
4+
5+
export const collections = {
6+
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
7+
};
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Example Guide
3+
description: A guide in my new Starlight docs site.
4+
---
5+
6+
Guides lead a user through a specific task they want to accomplish, often with a sequence of steps.
7+
Writing a good guide requires thinking about what your users are trying to do.
8+
9+
## Further reading
10+
11+
- Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
title: Welcome to Starlight
3+
description: Get started building your docs site with Starlight.
4+
template: splash # Remove or comment out this line to display the site sidebar on this page.
5+
hero:
6+
tagline: Congrats on setting up a new Starlight project!
7+
image:
8+
file: ../../assets/houston.webp
9+
actions:
10+
- text: Example Guide
11+
link: /guides/example/
12+
icon: right-arrow
13+
- text: Read the Starlight docs
14+
link: https://starlight.astro.build
15+
icon: external
16+
variant: minimal
17+
---
18+
19+
import { Card, CardGrid } from '@astrojs/starlight/components';
20+
21+
## Next steps
22+
23+
<CardGrid stagger>
24+
<Card title="Update content" icon="pencil">
25+
Edit `src/content/docs/index.mdx` to see this page change.
26+
</Card>
27+
<Card title="Change page layout" icon="document">
28+
Delete `template: splash` in `src/content/docs/index.mdx` to display a
29+
sidebar on this page.
30+
</Card>
31+
<Card title="Add new content" icon="add-document">
32+
Add Markdown or MDX files to `src/content/docs` to create new pages.
33+
</Card>
34+
<Card title="Configure your site" icon="setting">
35+
Edit your `sidebar` and other config in `astro.config.mjs`.
36+
</Card>
37+
<Card title="Read the docs" icon="open-book">
38+
Learn more in [the Starlight Docs](https://starlight.astro.build/).
39+
</Card>
40+
</CardGrid>

0 commit comments

Comments
 (0)