Files
mandaloreandClaude Opus 5.5 95a54e9ec2 Add per-site READMEs describing what each site serves
Covers pages, data sources, config knobs, files and deploy target for
40k-rankings, aos-rankings, events, kingmaker and scouting. Also lists
events in the root README layout and points to the per-site docs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-22 16:46:40 -05:00

71 lines
3.1 KiB
Markdown

# gateway-gamers.net
Monorepo for the `*.gateway-gamers.net` static sites. Each site is an independent
Vite + Tailwind v4 + daisyUI project, deployed to its own subdomain, but they
share a header shell, footer, and hero-carousel images so a logo/photo swap
doesn't need to happen four times.
## Layout
```
shared/
header.template.html # full header markup, nav swapped in at build time
footer.html # byte-identical across every site
images/ # logo + carousel photos, one copy
scripts/
render-header.mjs # shared/header.template.html + sites/<site>/nav.html -> sites/<site>/public/header.html
sites/
40k-rankings/ # 40K team leaderboard (ITC, LMC, Stat Check ELO)
aos-rankings/ # Age of Sigmar team leaderboard (ITC)
events/ # upcoming events across followed BCP circuits
kingmaker/ # Kingmaker league hub (Google Forms/Sheets)
scouting/ # BCP event roster scout + matchup matrix generator
```
Each site has its own `README.md` describing what it serves, where its data
comes from and what to edit.
Each `sites/<name>/` is a full Vite project (own `package.json`, `vite.config.js`,
`src/`, `index.html`). Two things are *not* duplicated per site:
- `public/footer.html` and `public/images` are symlinks into `../../../shared/`.
- `public/header.html` is generated (gitignored) from `shared/header.template.html`
plus that site's own `nav.html` (just its `<li>` nav entries) — run automatically
via the `predev`/`prebuild` npm scripts, so `npm run dev` / `npm run build` always
regenerate it fresh. Nothing else about the header (carousel, logo, theme toggle)
varies per site.
To add a new site's nav, edit `sites/<name>/nav.html`. To change the shared photos,
logo, footer copy, or header markup/structure, edit under `shared/` once.
## Commands (per site)
```bash
cd sites/<name>
npm install
npm run dev # http://localhost:5173, regenerates header.html first
npm run build # -> dist/
npm run preview
```
## Deploy
`.gitea/workflows/` at the repo root builds/deploys each site independently
(one workflow per site, path-triggered via `on.push.paths`), plus a
`deploy-shared.yml` workflow that syncs `shared/images/` and
`shared/footer.html` to `/var/www/domains/gateway-gamers.net/shared/` on
the webserver — the box the Gitea Actions runner (`act_runner`, host mode,
no Docker) executes on. Every site's nginx server block points `/images/`
and `/footer.html` at that shared directory via `alias`, so the webserver
only ever holds one copy of the ~25MB of images. See each
`sites/<name>/<name>.gateway-gamers.net.conf` for the live nginx reference
config (applied manually on the box — CI doesn't touch nginx).
A separate `refresh-elo.yml` workflow runs weekly (~02:00 UTC) to refresh
`40k-rankings`' stat-check ELO data and push the result back to `main`,
authenticating via the `SYNC_ACCESS_TOKEN` repo secret.
This previously ran on self-hosted GitLab CI (`.gitlab-ci.yml`); that
GitLab instance was migrated to Gitea, so the pipeline was ported to
Gitea Actions accordingly.