3.2 KiB
CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Project Overview
JAILGAMES is a static website for publishing and downloading indie games. Built with Eleventy (11ty) v3 using Nunjucks templates, served via Nginx in Docker. The entire site must be in Valencian (Catalan variant). All UI text, game descriptions, taglines, and any user-facing content must be written in Valencian.
Commands
npm ci— install dependenciesnpm run serve— local dev server on port 8080 (auto-rebuilds on changes)npm run build— generate static site into_site/npm run clean— delete_site/docker compose up --build -d— build and run locally via Docker on port 80
Architecture
Static site generator (Eleventy) configured in .eleventy.js:
- Input:
src/— Output:_site/ - Templates: Nunjucks (
.njk), data files: YAML - Custom "games" collection built by reading all
src/games/*.yamlfiles, sorted byrelease_datedesc - Custom filters:
dateFormat(Spanish locale dates),markdown(markdown-it rendering) - Passthrough copies:
static/logo->logo,static/games->games,downloads/,src/css,src/js
Data-driven game pages: Each game is a YAML file in src/games/<slug>.yaml with fields: name, slug, tagline, description, version, release_date, tags, logo, screenshots, downloads (per-platform), engine, players, genre, repo. The src/game.njk template uses Eleventy pagination to generate /game/<slug>/ pages from the games collection.
Templates hierarchy:
base.njk— HTML shell (head, header, footer, CSS/JS includes)game-card.njk— game card partial used on the homepage gridgame-page.njk— full game detail page layoutindex.njk— homepage iteratingcollections.games
Static assets live outside src/: static/ for images, downloads/ for game binaries. These are passed through to the build output and also mounted as Docker volumes for live updates without rebuilding.
Adding a New Game
- Create
src/games/<slug>.yaml(copy from an existing game) - Add images to
static/games/<slug>/ - Add downloadable files to
downloads/<slug>/ - Ensure paths in the YAML match the actual files
Deployment
- Local Docker:
docker compose up --build -d(multi-stage Dockerfile: node build + nginx serve) - Production (esta máquina):
./deploy.sh— compila y copia a los volúmenes Docker persistentes - Production manual: Uses
docker-compose.portainer.ymlwith Traefik reverse proxy - Domain:
jailgames.sustancia.synology.me
deploy.sh
Script para desplegar cambios en producción local. Ejecutar desde la raíz del proyecto:
./deploy.sh
Lo que hace:
npm ci— instala dependenciasnpm run build— compila el sitio en_site/- Copia
_site/a/var/volumes/web_jailgames/(contenido HTML) - Copia
downloads/a/var/volumes/web_jailgames/downloads/(binarios de juegos) - Copia
nginx.confa/var/volumes/web_jailgames-nginx/jailgames.conf - Recarga nginx en el contenedor
jailgames(si está activo)
Requiere docker (para el reload de nginx). Los volúmenes en /var/volumes/ son propiedad del usuario sergio.