Skip to content

Commit 7637001

Browse files
authored
Merge pull request #361 from CodeForPhilly/docs-migrate-astro
Migrate docs site from Mkdocs 1 to Astro+Starlight
2 parents a9f440f + c77068f commit 7637001

34 files changed

Lines changed: 6517 additions & 415 deletions

.github/workflows/deploy-docs.yml

Lines changed: 12 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- main
77
paths:
8-
- "docs/user-docs/**"
8+
- "docs/**"
99

1010
env:
1111
PROJECT_ID: "benefit-decision-toolkit-play"
@@ -23,38 +23,20 @@ jobs:
2323
- name: Checkout repository
2424
uses: actions/checkout@v4
2525

26-
# -------------------------
27-
# Install Python & MKDocs
28-
# -------------------------
29-
- name: Set up Python
30-
uses: actions/setup-python@v4
31-
with:
32-
python-version: "3.x"
33-
34-
- name: Cache Python dependencies
35-
uses: actions/cache@v4
26+
- name: Set up Node.js
27+
uses: actions/setup-node@v4
3628
with:
37-
path: ~/.cache/pip
38-
key: ${{ runner.os }}-pip-${{ hashFiles('docs/user-docs/requirements.txt') }}
39-
restore-keys: |
40-
${{ runner.os }}-pip-
29+
node-version: "20"
30+
cache: "npm"
31+
cache-dependency-path: docs/package-lock.json
4132

42-
- name: Install Python dependencies
43-
run: |
44-
python -m pip install --upgrade pip
45-
pip install -r docs/user-docs/requirements.txt
33+
- name: Install dependencies
34+
working-directory: docs
35+
run: npm install
4636

47-
- name: Build MKDocs site
48-
working-directory: docs/user-docs
49-
run: mkdocs build
50-
51-
# -------------------------
52-
# Install Node & Firebase CLI
53-
# -------------------------
54-
- name: Set up Node
55-
uses: actions/setup-node@v3
56-
with:
57-
node-version: "18"
37+
- name: Build Astro site
38+
working-directory: docs
39+
run: npm run build
5840

5941
- name: Install Firebase CLI
6042
run: npm install -g firebase-tools

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

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+
}

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+
}

docs/README.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Starlight Starter Kit: Basics
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
7+
```
8+
9+
> 🧑‍🚀 **Seasoned astronaut?** Delete this file. Have fun!
10+
11+
## 🚀 Project Structure
12+
13+
Inside of your Astro + Starlight project, you'll see the following folders and files:
14+
15+
```
16+
.
17+
├── public/
18+
├── src/
19+
│ ├── assets/
20+
│ ├── content/
21+
│ │ └── docs/
22+
│ └── content.config.ts
23+
├── astro.config.mjs
24+
├── package.json
25+
└── tsconfig.json
26+
```
27+
28+
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.
29+
30+
Images can be added to `src/assets/` and embedded in Markdown with a relative link.
31+
32+
Static assets, like favicons, can be placed in the `public/` directory.
33+
34+
## 🧞 Commands
35+
36+
All commands are run from the root of the project, from a terminal:
37+
38+
| Command | Action |
39+
| :------------------------ | :----------------------------------------------- |
40+
| `npm install` | Installs dependencies |
41+
| `npm run dev` | Starts local dev server at `localhost:4321` |
42+
| `npm run build` | Build your production site to `./dist/` |
43+
| `npm run preview` | Preview your build locally, before deploying |
44+
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
45+
| `npm run astro -- --help` | Get help using the Astro CLI |
46+
47+
## 👀 Want to learn more?
48+
49+
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).

docs/astro.config.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// @ts-check
2+
import { defineConfig } from "astro/config";
3+
import starlight from "@astrojs/starlight";
4+
5+
// https://astro.build/config
6+
export default defineConfig({
7+
integrations: [
8+
starlight({
9+
title: "BDT Docs",
10+
description:
11+
"User guide for the Benefit Decision Toolkit screener builder app",
12+
sidebar: [
13+
{ label: "Introduction", slug: "intro" },
14+
{ label: "User Guide", slug: "user-guide" },
15+
{ label: "Custom Checks", slug: "custom-checks" },
16+
],
17+
}),
18+
],
19+
});

docs/developer-docs/input-definition-transformation.md

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

0 commit comments

Comments
 (0)