Skip to content

Commit bd6c924

Browse files
committed
docs: add setup guide
1 parent f47042b commit bd6c924

File tree

1 file changed

+89
-0
lines changed

1 file changed

+89
-0
lines changed

docs/src/content/pages/index.mdx

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
title: Astro Vitesse
33
display: 'Give your pages an elegant touch with Astro Vitesse'
44
description: 'Give your pages an elegant touch with Astro Vitesse'
5+
tocAlwaysOn: true
56
---
67

78
import Card from '@/components/Card.astro'
89
import SponsorButton from '@/components/SponsorButton.astro'
910
import LinkWithIcon from '@/components/LinkWithIcon.astro'
1011

12+
[[toc]]
13+
1114
Everything you need to create a stunning website. Fast, affordable and easy to use.
1215

1316
It's inspired by <LinkWithIcon href="https://antfu.me" iconUrl="https://antfu.me/favicon.svg">antfu.me</LinkWithIcon> <br />
@@ -36,6 +39,92 @@ Astro Vitesse ships as a framework-agnostic, complete solution. Extend with Reac
3639

3740
</div>
3841

42+
## Set up Astro Vitesse
43+
44+
To follow this guide, you’ll need an existing Astro project.
45+
46+
### Add the Astro Vitesse integration
47+
48+
Astro Vitesse is an [Astro integration](https://docs.astro.build/en/guides/integrations-guide/). Add it to your site by running the `astro add` command in your project’s root directory:
49+
50+
```sh
51+
npx astro add starlight
52+
```
53+
54+
This will install the required dependencies and add Starlight to the `integrations` array in your Astro config file.
55+
56+
### Configure the integration
57+
58+
The Astro Vitesse integration is configured in your `astro.config.mjs` file.
59+
60+
Add a `title` to get started:
61+
62+
```js
63+
import { defineConfig } from 'astro'
64+
import vitesse from 'astro-vitesse'
65+
66+
export default defineConfig({
67+
integrations: [
68+
vitesse({
69+
title: 'My Site',
70+
})
71+
]
72+
})
73+
```
74+
75+
### Configure UnoCSS
76+
77+
Astro Vitesse uses [UnoCSS](https://unocss.dev/) for styling. To configure UnoCSS, create a `unocss.config.ts` file in your project’s root directory:
78+
79+
```ts
80+
import { defineConfig } from 'astro-vitesse/theme'
81+
82+
export default defineConfig({})
83+
```
84+
85+
### Configure content collections
86+
87+
Astro Vitesse is built on top of Astro’s [content collections](https://docs.astro.build/en/guides/content-collections/), which are configured in the `src/content/config.ts` file.
88+
89+
Create or update the content config file, adding a `pages` collection that uses Starlight’s `pagesSchema`:
90+
91+
```ts
92+
import { defineCollection } from 'astro:content'
93+
import { pagesSchema } from 'astro-vitesse/schema'
94+
95+
export const collections = {
96+
pages: defineCollection({ schema: pagesSchema() }),
97+
}
98+
```
99+
100+
### Add content
101+
102+
Astro Vitesse is now configured and it’s time to add some content!
103+
104+
Create a `src/content/pages/` directory and start by adding an `index.md` file.
105+
This will be the homepage of your new site:
106+
107+
```mdx
108+
---
109+
title: Welcome to Astro Vitesse
110+
description: 'Give your pages an elegant touch with Astro Vitesse'
111+
---
112+
113+
Welcome to my website!
114+
```
115+
116+
Astro Vitesse uses file-based routing, which means every Markdown, MDX, or Markdoc file in `src/content/pages/` will turn into a page on your site. Frontmatter metadata (the `title` and `description` fields in the example above) can change how each page is displayed.
117+
118+
## Start the development server
119+
120+
When working locally, [Astro’s development server](https://docs.astro.build/en/reference/cli-reference/#astro-dev) lets you preview your work and automatically refreshes your browser when you make changes.
121+
122+
Inside your project directory, run the following command to start the development server:
123+
124+
```sh
125+
npm run dev
126+
```
127+
39128
<div class="flex-auto"></div>
40129

41130
---

0 commit comments

Comments
 (0)