Skip to content

Commit e7f4975

Browse files
authored
feat(docs): site migration (#1781)
1 parent 95fd22f commit e7f4975

File tree

87 files changed

+11218
-11299
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+11218
-11299
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Astro Site Workflow
2+
description: Build and test Astro sites.
3+
4+
inputs:
5+
working_directory:
6+
required: false
7+
default: "."
8+
description: The working directory for this workflow
9+
node_version:
10+
required: false
11+
default: "22"
12+
description: The node version to use.
13+
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: ⚙️ Setup Node
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: ${{ inputs.node_version }}
21+
22+
- name: ⬇️ Install Dependencies
23+
run: npm install
24+
shell: ${{ inputs.shell }}
25+
working-directory: ${{ inputs.working_directory }}
26+
27+
- name: ✨ Check Format
28+
run: npm run format:check
29+
shell: ${{ inputs.shell }}
30+
working-directory: ${{ inputs.working_directory }}
31+
32+
- name: 📦 Build Site
33+
uses: withastro/action@v2
34+
with:
35+
path: ${{ inputs.working_directory }}
36+
node-version: ${{ inputs.node_version }}

.github/workflows/docs.yaml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,48 @@
11
name: docs
22

3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
37
on:
48
pull_request:
59
paths:
610
- ".github/workflows/docs.yaml"
711
- "docs/**"
12+
push:
13+
branches: [main]
14+
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
819

920
jobs:
1021
build:
1122
runs-on: ubuntu-latest
1223

13-
defaults:
14-
run:
15-
working-directory: docs
24+
name: 🌐 Site Build
1625

1726
steps:
1827
- name: 📚 Git Checkout
1928
uses: actions/checkout@v4
2029

21-
- name: ⚙️ Setup Node
22-
uses: actions/setup-node@v4
30+
- name: 📦 Build Site
31+
uses: ./.github/actions/astro_site
2332
with:
24-
node-version: 18.x
25-
cache: yarn
26-
cache-dependency-path: docs/yarn.lock
33+
working_directory: ./docs
2734

28-
- name: 📦 Install Dependencies
29-
run: yarn install --frozen-lockfile
35+
deploy:
36+
needs: build
37+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
3038

31-
- name: ✨ Check Format
32-
run: yarn run format:check
39+
runs-on: ubuntu-latest
3340

34-
- name: 🧹 Lint
35-
run: yarn run lint
41+
environment:
42+
name: github-pages
43+
url: ${{ steps.deployment.outputs.page_url }}
3644

37-
- name: 👷 Build website
38-
run: yarn build
45+
steps:
46+
- name: 🚀 Deploy to GitHub Pages
47+
id: deployment
48+
uses: actions/deploy-pages@v4

docs/.eslintrc.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

docs/.gitignore

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
# Dependencies
2-
/node_modules
1+
# build output
2+
dist/
3+
# generated types
4+
.astro/
35

4-
# Production
5-
/build
6-
7-
# Generated files
8-
.docusaurus
9-
.cache-loader
10-
11-
# Misc
12-
.DS_Store
13-
.env.local
14-
.env.development.local
15-
.env.test.local
16-
.env.production.local
6+
# dependencies
7+
node_modules/
178

9+
# logs
1810
npm-debug.log*
1911
yarn-debug.log*
2012
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

docs/.prettierignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
node_modules
2-
/build
3-
/public/build
4-
.env
5-
.docusaurus
1+
src/components/**/*.mdx

docs/.prettierrc

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
11
{
2-
"singleQuote": true
2+
"printWidth": 100,
3+
"semi": true,
4+
"singleQuote": true,
5+
"tabWidth": 2,
6+
"trailingComma": "es5",
7+
"useTabs": true,
8+
"plugins": ["prettier-plugin-astro"],
9+
"overrides": [
10+
{ "files": [".*", "*.json", "*.md", "*.toml", "*.yml"], "options": { "useTabs": false } },
11+
{ "files": ["*.md", "*.mdx"], "options": { "printWidth": 80, "proseWrap": "always" } }
12+
]
313
}

docs/README.md

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
1-
# 📚 Dart Frog Site
1+
# Dart Frog Site 📚
22

3-
This website is built using [Docusaurus 3](https://docusaurus.io/), a modern static website generator.
3+
[![Built with Starlight](https://astro.badg.es/v2/built-with-starlight/tiny.svg)](https://starlight.astro.build)
44

5-
### ⚙️ Installation
5+
Home of the [dart-frog.dev](https://dart-frog.dev) site.
66

7-
```
8-
yarn install
9-
```
7+
## 🧞 Commands
108

11-
### 🧑‍💻 Local Development
9+
All commands are run from the root of the project, from a terminal:
1210

13-
```
14-
yarn start
15-
```
11+
| Command | Action |
12+
| :------------------------ | :----------------------------------------------- |
13+
| `npm install` | Installs dependencies |
14+
| `npm run dev` | Starts local dev server at `localhost:4321` |
15+
| `npm run build` | Build your production site to `./dist/` |
16+
| `npm run preview` | Preview your build locally, before deploying |
17+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
18+
| `npm run astro -- --help` | Get help using the Astro CLI |
1619

17-
This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.
20+
## 👀 Want to learn more?
1821

19-
### 📦 Build
20-
21-
```
22-
yarn build
23-
```
24-
25-
This command generates static content into the `build` directory and can be served using any static contents hosting service.
22+
Check out [Starlight’s docs](https://starlight.astro.build/), read
23+
[the Astro documentation](https://docs.astro.build), or jump into the
24+
[Astro Discord server](https://astro.build/chat).

docs/astro.config.mjs

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
// @ts-check
2+
import { defineConfig } from 'astro/config';
3+
import starlight from '@astrojs/starlight';
4+
import tailwindcss from '@tailwindcss/vite';
5+
import starlightLinksValidator from 'starlight-links-validator';
6+
7+
const site = 'https://dart-frog.dev/';
8+
9+
// https://astro.build/config
10+
export default defineConfig({
11+
site,
12+
integrations: [
13+
starlight({
14+
title: 'Dart Frog',
15+
tagline: 'A fast, minimalistic backend framework for Dart 🎯',
16+
logo: {
17+
light: './src/assets/logo-dark.png',
18+
dark: './src/assets/logo-light.png',
19+
replacesTitle: true,
20+
},
21+
favicon: 'favicon.ico',
22+
expressiveCode: {
23+
themes: ['dark-plus', 'github-light'],
24+
},
25+
social: [
26+
{
27+
icon: 'github',
28+
label: 'GitHub',
29+
href: 'https://github.com/dart-frog-dev/dart_frog',
30+
},
31+
{
32+
icon: 'discord',
33+
label: 'Discord',
34+
href: 'https://discord.gg/dart-frog',
35+
},
36+
],
37+
editLink: {
38+
baseUrl: 'https://github.com/dart-frog-dev/dart_frog/edit/main/docs',
39+
},
40+
head: [
41+
{
42+
tag: 'meta',
43+
attrs: { property: 'og:image', content: site + 'open-graph.png?v=1' },
44+
},
45+
{
46+
tag: 'meta',
47+
attrs: {
48+
property: 'twitter:image',
49+
content: site + 'open-graph.png?v=1',
50+
},
51+
},
52+
],
53+
customCss: ['./src/tailwind.css', './src/styles/landing.css'],
54+
sidebar: [
55+
{
56+
label: 'Getting Started',
57+
link: '/getting-started/',
58+
},
59+
{
60+
label: 'Basics',
61+
autogenerate: { directory: 'basics' },
62+
},
63+
{
64+
label: 'Tutorials',
65+
autogenerate: { directory: 'tutorials' },
66+
},
67+
{
68+
label: 'Deploy',
69+
autogenerate: { directory: 'deploy' },
70+
},
71+
{
72+
label: 'Advanced',
73+
autogenerate: { directory: 'advanced' },
74+
},
75+
{
76+
label: '🗺️ Roadmap',
77+
link: '/roadmap/',
78+
},
79+
],
80+
plugins: [
81+
starlightLinksValidator({
82+
errorOnFallbackPages: false,
83+
errorOnInconsistentLocale: true,
84+
exclude: ['http://localhost:8080', 'http://localhost:8080/**'],
85+
}),
86+
],
87+
}),
88+
],
89+
vite: { plugins: [tailwindcss()] },
90+
});

docs/babel.config.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

docs/docs/advanced/_category_.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)