Skip to content

Commit 8c1fa84

Browse files
committed
docs: setup new docs
1 parent fdd9cd1 commit 8c1fa84

File tree

17 files changed

+473
-40
lines changed

17 files changed

+473
-40
lines changed

apps/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

apps/docs/.vscode/extensions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode"],
3+
"unwantedRecommendations": []
4+
}

apps/docs/.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

apps/docs/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Starlight Starter Kit: Tailwind
2+
3+
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
4+
5+
```
6+
npm create astro@latest -- --template starlight/tailwind
7+
```
8+
9+
[![Open in StackBlitz](https://developer.stackblitz.com/img/open_in_stackblitz.svg)](https://stackblitz.com/github/withastro/starlight/tree/main/examples/tailwind)
10+
[![Open with CodeSandbox](https://assets.codesandbox.io/github/button-edit-lime.svg)](https://codesandbox.io/p/sandbox/github/withastro/starlight/tree/main/examples/tailwind)
11+
[![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/withastro/starlight&create_from_path=examples/tailwind)
12+
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Fwithastro%2Fstarlight%2Ftree%2Fmain%2Fexamples%2Ftailwind&project-name=my-starlight-docs&repository-name=my-starlight-docs)
13+
14+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
15+
16+
## 🚀 Project Structure
17+
18+
Inside of your Astro + Starlight project, you'll see the following folders and files:
19+
20+
```
21+
.
22+
├── public/
23+
├── src/
24+
│ ├── assets/
25+
│ ├── content/
26+
│ │ ├── docs/
27+
│ └── content.config.ts
28+
├── astro.config.mjs
29+
├── package.json
30+
├── tailwind.config.mjs
31+
└── tsconfig.json
32+
```
33+
34+
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.
35+
36+
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
37+
38+
Static assets, like favicons, can be placed in the `public/` directory.
39+
40+
## 🧞 Commands
41+
42+
All commands are run from the root of the project, from a terminal:
43+
44+
| Command | Action |
45+
| :------------------------ | :----------------------------------------------- |
46+
| `npm install` | Installs dependencies |
47+
| `npm run dev` | Starts local dev server at `localhost:4321` |
48+
| `npm run build` | Build your production site to `./dist/` |
49+
| `npm run preview` | Preview your build locally, before deploying |
50+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
51+
| `npm run astro -- --help` | Get help using the Astro CLI |
52+
53+
## 👀 Want to learn more?
54+
55+
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).

apps/docs/astro.config.mjs

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

apps/docs/package.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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.31.1",
14+
"@astrojs/starlight-tailwind": "^3.0.0",
15+
"@astrojs/tailwind": "^5.1.4",
16+
"astro": "^5.1.5",
17+
"sharp": "^0.32.5",
18+
"tailwindcss": "^3.4.4"
19+
}
20+
}

apps/docs/public/favicon.svg

Lines changed: 1 addition & 0 deletions
Loading

apps/docs/src/assets/houston.webp

96.2 KB
Binary file not shown.

apps/docs/src/content.config.ts

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

apps/docs/src/content/docs/index.mdx

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: Welcome to Starlight
3+
description: Get started building your docs site with Starlight.
4+
template: splash
5+
hero:
6+
title: |
7+
Welcome to Starlight with
8+
<span
9+
class="font-black text-transparent
10+
bg-clip-text bg-gradient-to-b
11+
from-accent-700 to-accent-400
12+
dark:from-accent-500 dark:to-accent-200"
13+
>
14+
Tailwind
15+
</span>
16+
tagline: Congrats on setting up a new Starlight project!
17+
image:
18+
file: ../../assets/houston.webp
19+
actions:
20+
- text: Example Guide
21+
link: /guides/example/
22+
icon: right-arrow
23+
- text: Read the Starlight docs
24+
link: https://starlight.astro.build
25+
icon: external
26+
variant: minimal
27+
---
28+
29+
import { Card, CardGrid } from '@astrojs/starlight/components';
30+
31+
## Next steps
32+
33+
<CardGrid stagger>
34+
<Card title="Update content" icon="pencil">
35+
Edit `src/content/docs/index.mdx` to see this page change.
36+
</Card>
37+
<Card title="Add new content" icon="add-document">
38+
Add Markdown or MDX files to `src/content/docs` to create new pages.
39+
</Card>
40+
<Card title="Configure your site" icon="setting">
41+
Edit your `sidebar` and other config in `astro.config.mjs`.
42+
</Card>
43+
<Card title="Read the docs" icon="open-book">
44+
Learn more in [the Starlight Docs](https://starlight.astro.build/).
45+
</Card>
46+
</CardGrid>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: Example Reference
3+
description: A reference page in my new Starlight docs site.
4+
---
5+
6+
Reference pages are ideal for outlining how things work in terse and clear terms.
7+
Less concerned with telling a story or addressing a specific use case, they should give a comprehensive outline of what your documenting.
8+
9+
## Further reading
10+
11+
- Read [about reference](https://diataxis.fr/reference/) in the Diátaxis framework

apps/docs/src/tailwind.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
/*
6+
Add additional Tailwind styles to this file, for example with @layer:
7+
https://tailwindcss.com/docs/adding-custom-styles#using-css-and-layer
8+
*/

apps/docs/tailwind.config.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import colors from 'tailwindcss/colors';
2+
import starlightPlugin from '@astrojs/starlight-tailwind';
3+
4+
/** @type {import('tailwindcss').Config} */
5+
export default {
6+
content: ['./src/**/*.{astro,html,js,jsx,md,mdx,svelte,ts,tsx,vue}'],
7+
theme: {
8+
extend: {
9+
colors: {
10+
// Your preferred accent color. Indigo is closest to Starlight’s defaults.
11+
accent: colors.indigo,
12+
// Your preferred gray scale. Zinc is closest to Starlight’s defaults.
13+
gray: colors.zinc,
14+
},
15+
},
16+
},
17+
plugins: [starlightPlugin()],
18+
};

apps/docs/tsconfig.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"extends": "astro/tsconfigs/strict",
3+
"include": [".astro/types.d.ts", "**/*"],
4+
"exclude": ["dist"]
5+
}

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111
},
1212
"private": true,
1313
"devDependencies": {
14-
"@analogjs/platform": "1.12.0",
15-
"@analogjs/vite-plugin-angular": "1.12.0",
16-
"@analogjs/vitest-angular": "1.12.0",
14+
"@analogjs/astro-angular": "1.12.0",
15+
"@analogjs/platform": "1.12.1",
16+
"@analogjs/vite-plugin-angular": "1.12.1",
17+
"@analogjs/vitest-angular": "1.12.1",
1718
"@angular-devkit/build-angular": "19.0.7",
1819
"@angular-devkit/core": "19.0.7",
1920
"@angular-devkit/schematics": "19.0.7",
@@ -100,8 +101,8 @@
100101
"vitest-webgl-canvas-mock": "^1.1.0"
101102
},
102103
"dependencies": {
103-
"@analogjs/content": "1.12.0",
104-
"@analogjs/router": "1.12.0",
104+
"@analogjs/content": "1.12.1",
105+
"@analogjs/router": "1.12.1",
105106
"@angular/animations": "19.0.6",
106107
"@angular/common": "19.0.6",
107108
"@angular/compiler": "19.0.6",

0 commit comments

Comments
 (0)