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,21 +1,25 @@
// @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({
redirects: {
'/': '/guides',
},
integrations: [ integrations: [
starlight({ starlight({
title: 'My Docs', title: 'WCB',
social: { social: {
github: 'https://github.com/withastro/starlight', npm: 'https://www.npmjs.com/package/web-component-base',
sourcehut: 'https://sr.ht/~ayoayco/wcb/',
}, },
sidebar: [ sidebar: [
{ {
label: 'Guides', label: 'Guides',
items: [ items: [
// Each item here is one entry in the navigation menu. // Each item here is one entry in the navigation menu.
{ label: 'Example Guide', slug: 'guides/example' }, { label: 'Getting Started', slug: 'guides' },
], ],
}, },
{ {
@ -25,4 +29,4 @@ export default defineConfig({
], ],
}), }),
], ],
}); })

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