feat(docs): set up first guide page

This commit is contained in:
Ayo Ayco 2025-03-26 19:50:07 +01:00
parent 77b53dbbda
commit 3358e7c805
6 changed files with 2803 additions and 171 deletions

View file

@ -1,28 +1,32 @@
// @ts-check // @ts-check
import { defineConfig } from 'astro/config'; import { defineConfig } from 'astro/config'
import starlight from '@astrojs/starlight'; import starlight from '@astrojs/starlight'
// https://astro.build/config // https://astro.build/config
export default defineConfig({ export default defineConfig({
integrations: [ redirects: {
starlight({ '/': '/guides',
title: 'My Docs', },
social: { integrations: [
github: 'https://github.com/withastro/starlight', starlight({
}, title: 'WCB',
sidebar: [ social: {
{ npm: 'https://www.npmjs.com/package/web-component-base',
label: 'Guides', sourcehut: 'https://sr.ht/~ayoayco/wcb/',
items: [ },
// Each item here is one entry in the navigation menu. sidebar: [
{ label: 'Example Guide', slug: 'guides/example' }, {
], label: 'Guides',
}, items: [
{ // Each item here is one entry in the navigation menu.
label: 'Reference', { label: 'Getting Started', slug: 'guides' },
autogenerate: { directory: 'reference' }, ],
}, },
], {
}), label: 'Reference',
], autogenerate: { directory: 'reference' },
}); },
],
}),
],
})

View file

@ -14,4 +14,4 @@
"astro": "^5.5.3", "astro": "^5.5.3",
"sharp": "^0.32.5" "sharp": "^0.32.5"
} }
} }

View file

@ -1,5 +1,5 @@
--- ---
title: Example Guide title: Getting Started
description: A guide in my new Starlight docs site. description: A guide in my new Starlight docs site.
--- ---

View file

@ -1,36 +0,0 @@
---
title: Welcome to Starlight
description: Get started building your docs site with Starlight.
template: splash
hero:
tagline: Congrats on setting up a new Starlight project!
image:
file: ../../assets/houston.webp
actions:
- text: Example Guide
link: /guides/example/
icon: right-arrow
- text: Read the Starlight docs
link: https://starlight.astro.build
icon: external
variant: minimal
---
import { Card, CardGrid } from '@astrojs/starlight/components';
## Next steps
<CardGrid stagger>
<Card title="Update content" icon="pencil">
Edit `src/content/docs/index.mdx` to see this page change.
</Card>
<Card title="Add new content" icon="add-document">
Add Markdown or MDX files to `src/content/docs` to create new pages.
</Card>
<Card title="Configure your site" icon="setting">
Edit your `sidebar` and other config in `astro.config.mjs`.
</Card>
<Card title="Read the docs" icon="open-book">
Learn more in [the Starlight Docs](https://starlight.astro.build/).
</Card>
</CardGrid>

View file

@ -31,7 +31,8 @@
"test": "vitest --run", "test": "vitest --run",
"test:watch": "vitest", "test:watch": "vitest",
"demo": "npx simple-server .", "demo": "npx simple-server .",
"site": "pnpm --filter site start", "site": "pnpm -F site start",
"docs": "pnpm -F docs start",
"build": "pnpm run clean && tsc && pnpm run copy:source", "build": "pnpm run clean && tsc && pnpm run copy:source",
"size-limit": "pnpm run build && size-limit", "size-limit": "pnpm run build && size-limit",
"clean": "rm -rf dist", "clean": "rm -rf dist",

File diff suppressed because it is too large Load diff