Merge the four independent gateway-gamers.net site repos (40k-rankings, aos-rankings, kingmaker, scouting) into one monorepo under sites/, preserving each site's full commit history via a manual subtree-style merge (git-subtree isn't available in this environment). - shared/: header.template.html (nav swapped in per site), footer.html, and images/ — previously byte-identical copies duplicated 4x (~100MB). - Each site's public/footer.html and public/images are now symlinks into shared/; public/header.html is generated at predev/prebuild time from shared/header.template.html + the site's own nav.html, so nav bars stay individual while everything else about the header is shared. - Single root .gitlab-ci.yml with path-scoped build/deploy jobs per site plus a deploy:shared job, replacing the 4 separate per-repo pipelines. - nginx confs (kept per-site as reference, same as before) gain location /images/ and location = /footer.html alias blocks pointing at a shared webserver directory, so the deployed site no longer duplicates the images either — see README.md for the full layout and the runbook for applying this on the webserver. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SBzcNkW7JcYipnAX6HfgmK
2.2 KiB
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/
aos-rankings/
kingmaker/
scouting/
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.htmlandpublic/imagesare symlinks into../../../shared/.public/header.htmlis generated (gitignored) fromshared/header.template.htmlplus that site's ownnav.html(just its<li>nav entries) — run automatically via thepredev/prebuildnpm scripts, sonpm run dev/npm run buildalways 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)
cd sites/<name>
npm install
npm run dev # http://localhost:5173, regenerates header.html first
npm run build # -> dist/
npm run preview
Deploy
.gitlab-ci.yml at the repo root builds/deploys each site independently
(path-scoped via rules: changes:), plus a deploy:shared job that syncs
shared/images/ and shared/footer.html to
/var/www/domains/gateway-gamers.net/shared/ on the webserver — the box
the GitLab Runner 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).