Skip to content

Commit ebda67e

Browse files
CoderCococlaudegithub-advanced-security[bot]
authored
docs: migrate documentation site from Jekyll to Docusaurus (#27)
## Summary Migrates the documentation site from Jekyll (GitHub Pages theme) to Docusaurus 3, modernizing the build toolchain and improving the developer experience for documentation maintenance. ## Key Changes - **Replaced Jekyll with Docusaurus**: Removed `_config.yml` and Jekyll-specific configuration; added `docusaurus.config.ts` with full Docusaurus 3.6.3 setup including theme configuration, navbar, and footer - **Updated documentation metadata**: Converted Jekyll front matter (`nav_order`, `parent`, `permalink`) to Docusaurus format (`sidebar_position`, `slug`) across all markdown files - **Added sidebar configuration**: Created `sidebars.ts` with autogenerated sidebar structure and `_category_.json` files for organizing Guides and Components sections - **Updated internal links**: Converted Jekyll Liquid template syntax (`{{ '/path/' | relative_url }}`) to Docusaurus-compatible paths (`/path`) - **Added styling**: Created `src/css/custom.css` with light/dark theme color variables and diagram styling, replacing Jekyll's `_includes/head_custom.html` - **Updated CI/CD workflow**: Renamed and refactored `.github/workflows/jekyll-gh-pages.yml` to `docusaurus-gh-pages.yml` with Node.js setup, npm dependency installation, and Docusaurus build steps - **Added package.json**: Created `docs/package.json` with Docusaurus dependencies and npm scripts for local development (`npm start`) and production builds - **Updated diagram rendering**: Modified `docs/diagrams/render.sh` to output SVG files to `docs/static/diagrams/` for Docusaurus static asset serving - **Added TypeScript config**: Created `tsconfig.json` extending Docusaurus TypeScript configuration ## Notable Implementation Details - Docusaurus is configured to serve docs at the root path (`/`) with GitHub Pages base URL `/game-server-deploy/` - Mermaid diagram support is enabled via `@docusaurus/theme-mermaid` theme - Color scheme respects user OS preference with separate light/dark theme variables - D2 diagram SVG files are pre-rendered during CI and served as static assets - Documentation can now be previewed locally with `cd docs && npm install && npm start` https://claude.ai/code/session_011UQT9Yu7T3U3393WiDXemb --------- Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 1cc7fed commit ebda67e

31 files changed

Lines changed: 20144 additions & 165 deletions

.github/workflows/docs-build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Docs build check
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "docs/**"
7+
- ".github/workflows/docs-build.yml"
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v4
21+
with:
22+
node-version: 20
23+
cache: npm
24+
cache-dependency-path: docs/package-lock.json
25+
26+
- name: Install D2
27+
run: |
28+
curl -fsSL https://d2lang.com/install.sh | sh -s -- --prefix "$HOME/.local"
29+
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
30+
31+
- name: Render D2 diagrams
32+
run: bash docs/diagrams/render.sh
33+
34+
- name: Install dependencies
35+
run: npm ci
36+
working-directory: docs
37+
38+
- name: Build
39+
run: npm run build
40+
working-directory: docs
Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,61 @@
1-
name: Deploy Docs
1+
name: Deploy Docusaurus docs site to GitHub Pages
22

33
on:
4-
# Runs on pushes targeting the default branch that touch the docs site
5-
# (or this workflow itself).
64
push:
75
branches: ["main"]
86
paths:
97
- "docs/**"
10-
- ".github/workflows/jekyll-gh-pages.yml"
8+
- ".github/workflows/docusaurus-gh-pages.yml"
119

12-
# Allows you to run this workflow manually from the Actions tab
1310
workflow_dispatch:
1411

15-
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
1612
permissions:
1713
contents: read
1814
pages: write
1915
id-token: write
2016

21-
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22-
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2317
concurrency:
2418
group: "pages"
2519
cancel-in-progress: false
2620

2721
jobs:
28-
# Build job
2922
build:
3023
runs-on: ubuntu-latest
3124
steps:
3225
- name: Checkout
33-
uses: actions/checkout@v5
26+
uses: actions/checkout@v4
27+
28+
- name: Setup Node.js
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version: 20
32+
cache: npm
33+
cache-dependency-path: docs/package-lock.json
34+
3435
- name: Install D2
3536
run: |
3637
curl -fsSL https://d2lang.com/install.sh | sh -s -- --prefix "$HOME/.local"
3738
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
39+
3840
- name: Render D2 diagrams
39-
run: docs/diagrams/render.sh
41+
run: bash docs/diagrams/render.sh
42+
43+
- name: Install Docusaurus dependencies
44+
run: npm ci
45+
working-directory: docs
46+
47+
- name: Build Docusaurus site
48+
run: npm run build
49+
working-directory: docs
50+
4051
- name: Setup Pages
4152
uses: actions/configure-pages@v5
42-
- name: Build with Jekyll
43-
uses: actions/jekyll-build-pages@v1
44-
with:
45-
source: ./docs
46-
destination: ./_site
47-
- name: Fix _site permissions
48-
run: sudo chmod -R +rX _site/
53+
4954
- name: Upload artifact
5055
uses: actions/upload-pages-artifact@v3
56+
with:
57+
path: docs/build
5158

52-
# Deployment job
5359
deploy:
5460
environment:
5561
name: github-pages

docs/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Docusaurus generated outputs — not committed
2+
.docusaurus/
3+
build/
4+
node_modules/

docs/_config.yml

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

docs/_includes/head_custom.html

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

docs/diagrams/render.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
#!/usr/bin/env bash
2-
# Render every .d2 source file in this directory to SVG next to it.
3-
# Run in CI (.github/workflows/jekyll-gh-pages.yml) before Jekyll builds;
4-
# run locally before `bundle exec jekyll serve` if you want to preview.
2+
# Render every .d2 source file in this directory to SVG.
3+
# Output goes to docs/static/diagrams/ so Docusaurus serves them at /diagrams/*.svg.
4+
# Run in CI (docusaurus-gh-pages.yml) before `npm run build`; run locally
5+
# before `npm start` if you want to preview diagram changes.
56
set -euo pipefail
6-
cd "$(dirname "$0")"
7+
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
8+
OUT_DIR="$SCRIPT_DIR/../static/diagrams"
9+
mkdir -p "$OUT_DIR"
10+
cd "$SCRIPT_DIR"
711
shopt -s nullglob
812
for f in *.d2; do
9-
out="${f%.d2}.svg"
13+
out="$OUT_DIR/${f%.d2}.svg"
1014
echo "rendering $f -> $out"
1115
d2 "$f" "$out"
1216
done
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Architecture
3-
nav_order: 2
3+
sidebar_position: 2
44
---
55

66
# Architecture
@@ -35,7 +35,7 @@ ECS / DynamoDB / Secrets Manager / CloudWatch via SDK v3. Players reach
3535
the game either direct to the task's public IP (UDP / TCP games) or
3636
through the ALB (HTTPS games).
3737

38-
![Game plane and operator]({{ '/diagrams/game-plane.svg' | relative_url }}){:.d2-diagram}
38+
![Game plane and operator](/diagrams/game-plane.svg)
3939

4040
### Serverless Discord bot
4141

@@ -45,7 +45,7 @@ it verifies the Ed25519 signature, replies with a deferred ack within
4545
Discord's 3-second budget, then fires the async `followup` Lambda for
4646
anything that touches ECS.
4747

48-
![Serverless Discord bot]({{ '/diagrams/discord-bot.svg' | relative_url }}){:.d2-diagram}
48+
![Serverless Discord bot](/diagrams/discord-bot.svg)
4949

5050
### Control loops (DNS + watchdog)
5151

@@ -56,15 +56,15 @@ pending-interaction row in DynamoDB. `watchdog` fires on a schedule and
5656
stops tasks whose `NetworkPacketsIn` has stayed below the threshold for
5757
`IDLE_CHECKS` consecutive intervals.
5858

59-
![Control loops]({{ '/diagrams/control-loops.svg' | relative_url }}){:.d2-diagram}
59+
![Control loops](/diagrams/control-loops.svg)
6060

6161
## The `/server-start` critical path
6262

6363
When a user types `/server-start palworld` in Discord, five AWS services and
6464
three Lambdas cooperate to return a usable `palworld.yourdomain.com` without
6565
ever letting the interaction time out.
6666

67-
![/server-start sequence]({{ '/diagrams/server-start.svg' | relative_url }}){:.d2-diagram}
67+
![/server-start sequence](/diagrams/server-start.svg)
6868

6969
After the session: either the user types `/server-stop palworld` (same flow
7070
but `stopTask` + `DELETE` A record), or the Watchdog Lambda notices
@@ -110,5 +110,5 @@ write the PR description as if you're explaining the new design.
110110
the idle counter — it is an `idle_checks` tag on each running task.
111111
Counter resets when a task stops, which is free.
112112

113-
See the [maintainer guide]({{ '/guides/maintainer/' | relative_url }}) for
113+
See the [maintainer guide](/guides/maintainer) for
114114
what tends to break these and what the failure modes look like.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"label": "Components",
3+
"position": 5,
4+
"link": {
5+
"type": "doc",
6+
"id": "components/index"
7+
}
8+
}
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
---
22
title: Components
3-
nav_order: 5
4-
has_children: true
3+
sidebar_position: 1
54
---
65

76
# Components
87

98
Deep-dives on each piece of the stack, for when the guides hand-wave past
109
something:
1110

12-
- **[Terraform]({{ '/components/terraform/' | relative_url }})** — every
11+
- **[Terraform](/components/terraform)** — every
1312
`.tf` file, variables, outputs, and AWS services touched.
14-
- **[Management app]({{ '/components/management-app/' | relative_url }})**
13+
- **[Management app](/components/management-app)**
1514
the Nest.js API, React dashboard, and `@gsd/shared` library.
16-
- **[Lambdas]({{ '/components/lambdas/' | relative_url }})** — the four
15+
- **[Lambdas](/components/lambdas)** — the four
1716
Node.js Lambdas (interactions, followup, update-dns, watchdog).
1817

1918
For the big picture, start at the
20-
[architecture overview]({{ '/architecture/' | relative_url }}).
19+
[architecture overview](/architecture).
Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
---
22
title: Lambdas
3-
parent: Components
4-
nav_order: 3
3+
sidebar_position: 4
54
---
65

76
# Lambdas
@@ -127,7 +126,7 @@ Event shape (simplified):
127126
```json
128127
{
129128
"detail": {
130-
"lastStatus": "RUNNING" | "STOPPED",
129+
"lastStatus": "RUNNING | STOPPED",
131130
"taskArn": "...",
132131
"clusterArn": "...",
133132
"group": "family:palworld-server"
@@ -204,7 +203,7 @@ Failure modes:
204203

205204
## The `/server-start` critical path, assembled
206205

207-
```
206+
```text
208207
User types /server-start palworld
209208
→ Discord POSTs to interactions Function URL
210209
→ interactions verifies + returns type:5 ack + async-invokes followup

0 commit comments

Comments
 (0)