CHALLENGE ${p.challenge} · ${tx(p.kind)}
${go(`project/${p.id}`,tx(p.name))}
${tx(p.intro)}
diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..29ae29c --- /dev/null +++ b/.dockerignore @@ -0,0 +1,15 @@ +* +!Dockerfile +!package.json +!scripts/ +!scripts/** +!content/ +!content/** +!tests/ +!tests/** +!docker/ +!docker/nginx.conf +!index.html +!app.js +!styles.css +!favicon.svg diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..dc6f9ce --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +# For your separate Nginx Proxy Manager box, replace 127.0.0.1 below +# with the portfolio Docker guest's LAN IP (NOT the proxy box's IP). +# Loopback is retained as a safe default until you configure that address. +BIND_ADDRESS=127.0.0.1 +PORTFOLIO_PORT=8080 diff --git a/.gitignore b/.gitignore index 746087d..532113e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ dist/ node_modules/ *.log +.env diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ec2f14f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +FROM node:22-alpine AS build +WORKDIR /app +COPY package.json ./ +COPY scripts/ ./scripts/ +COPY content/ ./content/ +COPY tests/ ./tests/ +COPY index.html app.js styles.css favicon.svg ./ +RUN npm test && npm run build + +FROM nginx:stable-alpine +COPY docker/nginx.conf /etc/nginx/nginx.conf +COPY --from=build /app/dist/ /usr/share/nginx/html/ +USER nginx +EXPOSE 8080 +HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ + CMD wget -q -O /dev/null http://127.0.0.1:8080/healthz || exit 1 +ENTRYPOINT ["nginx"] +CMD ["-g", "daemon off;"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..dac491a --- /dev/null +++ b/README.md @@ -0,0 +1,68 @@ +# Alvin Zilverstand — portfolio + +A custom, bilingual static portfolio for VISTA college Heerlen. Dark project journal with project dossiers, repository links and a provisional SBB evidence index. No external fonts, tracking, framework, CMS, runtime API requests or production Node service. + +## Run locally + +Requires Node 22 or newer. No dependency installation is necessary. + +```sh +npm run dev +``` + +Open http://127.0.0.1:4173. Set `PORT` to change the port. The development server binds to loopback only. + +```sh +npm test +npm run build +``` + +The build copies the five website files into `dist/`. It can be hosted at a domain root or a subdirectory. Hash-based routes mean no server fallback configuration is needed. Dutch is the default; `?lang=en#evidence` opens English evidence navigation. Language switching preserves the current page. + +## Maintain content + +See [the codebase index](docs/codebase-index.md) for the file map and rendering dependencies. + +Content editing stays on your computer. There is no public admin page or write API. + +- **Add a project:** run `npm run project:add -- my-project`. Open the new `content/projects/my-project.json` and replace the placeholder text. +- **Edit a project:** open its file in `content/projects/`. Text pairs are `[Dutch, English]`. Change `number` to change the display order; the first project is featured on the homepage. +- **Delete a project:** delete its JSON file. Its project card and evidence-index entries disappear on the next preview refresh or build. +- **Add/edit/delete an item:** edit the project's `evidence` array. Copy an existing entry to add one, change its values to edit it, or remove the entry to delete it. An empty array `[]` is allowed. +- **Profile and processes:** edit `content/settings.json`. + +An evidence item looks like this: + +```json +{ + "label": ["Testverslag", "Test report"], + "path": "projects/my-project/tests.md", + "type": "MD", + "codes": ["B1-K1-W4"] +} +``` + +Use `"directory": true` for a folder. Paths are relative to the school repository. Keep project `id` values stable to preserve links. Use exactly three `nodes` for the system diagram. Project numbers and challenge numbers are strings. + +Run `npm run dev` and refresh the browser to preview saved edits. Invalid content will prevent the preview content module from loading; run `npm run content` for a descriptive validation error. Run `npm run build` to validate and prepare publication. `content.js` is generated; do not edit it directly. `npm run content` regenerates it without building. + +Only deploy `dist/`. Everything in the generated content is public, so keep credentials and private documents out of these files. Repository links remain pinned to the `revision` in `content/settings.json`; update it after reviewing a newer snapshot. + +## Finish the exam content + +The interface is functional; the exam dossier is not yet complete. Summaries are based on the supplied school repository, not invented personal experience. Artifact paths were checked against the repository tree. DOCX contents were not reviewed and the source projects' test scripts were not executed. + +Before submission, add your personal contribution and reflection for every case study, confirm solo/team context, include actual test results, and substantiate improvement claims. Add evidence for B1-K2-W1, W2 and W3 (collaboration, presentation and evaluation). The current mappings are suggestions, not assessment decisions. Ask the examiner which artifacts and authenticity statements VISTA requires. General subjects, electives and institution-specific requirements are outside this vocational index. + +The source is SBB's 2024 qualification for Software Developer, code 25998: +https://kwalificatie-mijn.s-bb.nl/Details/DownloadDocument/1963420 + +English process names are informal translations. Reviewed 9 November 2026. + +Direct contact details, a CV, screenshots, assessed outcomes and personal reflections were not supplied, so the site does not invent them. Add these as real material becomes available. Project diagrams illustrate structure; they are not screenshots of running applications. + +## Host on Proxmox with Docker + +See [Docker hosting instructions](docs/docker-hosting.md) for installation, network access, reverse proxies and content updates. + +Run `docker compose up -d --build` from the repository on your Docker guest. Docker builds from the JSON source files; no manual build or Node installation is needed on the guest. The default binding is localhost only. Configure `.env` as described in the guide for LAN or proxy access. diff --git a/app.js b/app.js index a3f48a5..672b66b 100644 --- a/app.js +++ b/app.js @@ -1,78 +1,80 @@ -import { profile, projects, processes, source } from './content.js'; -const main = document.querySelector('main'); -let lang = new URLSearchParams(location.search).get('lang') === 'en' ? 'en' : 'nl'; -const t = pair => pair[lang === 'nl' ? 0 : 1]; -const esc = value => String(value).replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); -const tx = pair => esc(t(pair)); -const ext = (url, label, cls = '') => `${label}`; -const badge = text => `${esc(text)}`; -const route = () => location.hash.slice(1) || 'home'; -const go = (id, label, cls = '') => `${label}`; -function header() { - const current = route(); - document.querySelector('#header').innerHTML = `
Alvin Zilverstand · VISTA college, Heerlen
CHALLENGE ${p.challenge} · ${tx(p.kind)}
${tx(p.intro)}
SOFTWARE DEVELOPER / ${tx(['IN OPLEIDING','IN TRAINING'])}
${tx(['Ik ben Alvin. Derdejaars Software Developer bij VISTA college in Heerlen. Hier laat ik zien wat ik bouw, hoe het in elkaar zit en wat ik nog leer.','I’m Alvin, a third-year Software Developer student at VISTA college in Heerlen. This is what I build, how it fits together, and what I’m still learning.'])}
${tx(['Van requirements naar reserveringen.','From requirements to reservations.'])}
01 / ${tx(['SELECTIE','SELECTED'])}
02 / ${tx(['VAN PROJECT NAAR BEWIJS','FROM PROJECT TO EVIDENCE'])}
${tx(['Een project vertelt meer met de keuzes, documenten en tests ernaast. De bewijsindex verbindt die onderdelen met de acht beroepsspecifieke SBB-werkprocessen.','A project says more with its decisions, documents, and tests alongside it. The evidence index connects those artifacts to the eight vocational SBB work processes.'])}
${go('evidence',`${tx(['Open bewijsindex','Open evidence index'])} ↗`,'text-link')}01 / ${tx(['PROJECTARCHIEF','PROJECT ARCHIVE'])}
${tx(['Drie schoolprojecten, bekeken vanuit het probleem, de uitvoering en het beschikbare bewijs. De broncode blijft één klik verder.','Three school projects, through their problems, implementation, and available evidence. The source code is always one click away.'])}
PROJECT ${p.number} / CHALLENGE ${p.challenge}
${tx(p.intro)}
0${i+1}
${tx(body)}
04
${tx(['Dit zijn gevonden bronnen, geen goedgekeurde examenbewijzen. Documentinhoud en testresultaten moeten nog worden gecontroleerd.','These are located sources, not approved exam evidence. Document contents and test results still need review.'])}
05 / ${tx(['PERSOONLIJKE REFLECTIE','PERSONAL REFLECTION'])}
${tx(['Nog aan te vullen door Alvin: welke onderdelen heb ik zelf gemaakt, met wie werkte ik samen, welke feedback kreeg ik en wat zou ik anders doen?','To be completed by Alvin: which parts did I build myself, who did I work with, what feedback did I receive, and what would I do differently?'])}
02 / ${tx(['EXAMENPORTFOLIO','EXAM PORTFOLIO'])}
${tx(['Bronnen per werkproces. Een navigeerbare voorbereiding op mijn examen, met zichtbaar onderscheid tussen gevonden materiaal en wat nog ontbreekt.','Sources by work process. A navigable preparation for my exam, making the distinction between located material and missing evidence visible.'])}
${tx(['In opbouw. Koppelingen zijn voorlopig; aanwezigheid van code of een document bewijst nog geen beheersing. Persoonlijke bijdrage, resultaten en beoordeling moeten worden toegevoegd. Stem de definitieve bewijslast af met de examinator.','In progress. Mappings are provisional; code or a document alone does not demonstrate competence. Personal contributions, results, and assessment need to be added. Agree the final evidence requirements with the examiner.'])}
SBB / 25998 / 2024
${tx(['Deze index volgt de acht beroepsspecifieke werkprocessen uit het gekoppelde dossier. Generieke vakken, keuzedelen en VISTA-examenafspraken vallen buiten deze index. Engelse labels zijn eigen vertalingen.','This index follows the eight vocational work processes in the linked qualification. General subjects, electives, and VISTA exam arrangements are outside this index. English labels are informal translations.'])}
${ext(profile.qualification,tx(['Lees het officiële kwalificatiedossier','Read the official qualification document']),'text-link')}${tx(p.description)}
${found.length?`${tx(['Te controleren: inhoud, eigen bijdrage en geschiktheid voor het examen.','To verify: contents, personal contribution, and suitability for the exam.'])}
`:`03 / ${tx(['OVER MIJ','ABOUT ME'])}
${tx(['Software Developer in opleiding. Derdejaars bij VISTA college in Heerlen.','Software Developer in training. Third-year student at VISTA college in Heerlen.'])}
${tx(['Mijn schoolwerk loopt uiteen van websites en PHP-applicaties tot een magazijnsysteem en narrowcasting. Dit portfolio brengt de projecten en de bijbehorende bronnen bij elkaar.','My schoolwork ranges from websites and PHP applications to a warehouse system and narrowcasting. This portfolio brings those projects and their sources together.'])}
${tx(['Ik bouw dit portfolio voor mijn eindexamen. Daarna wil ik het verder gebruiken om mijn werk aan toekomstige werkgevers te laten zien.','I’m building this portfolio for my final exam. After that, I want to keep using it to show my work to future employers.'])}
${tx(['VERDER KIJKEN','TAKE A CLOSER LOOK'])}
${tx(['Een rechtstreeks contactadres en cv worden later toegevoegd.','A direct contact address and CV will be added later.'])}
${tx(['Deze pagina bestaat niet.','This page does not exist.'])}
${go('home',tx(['Terug naar het begin','Back to home']),'button')}Alvin Zilverstand · VISTA college, Heerlen
CHALLENGE ${esc(p.challenge)} · ${tx(p.kind)}
${tx(p.intro)}
${tx(['Ik ben Alvin. Derdejaars Software Developer bij VISTA college in Heerlen. Hier laat ik zien wat ik bouw, hoe het in elkaar zit en wat ik nog leer.','I’m Alvin, a third-year Software Developer student at VISTA college in Heerlen. This is what I build, how it fits together, and what I’m still learning.'])}
${tx(p.kind)}
01 / ${tx(['SELECTIE','SELECTED'])}
02 / ${tx(['VAN PROJECT NAAR BEWIJS','FROM PROJECT TO EVIDENCE'])}
${tx(['Een project vertelt meer met de keuzes, documenten en tests ernaast. De bewijsindex verbindt die onderdelen met de acht beroepsspecifieke SBB-werkprocessen.','A project says more with its decisions, documents, and tests alongside it. The evidence index connects those artifacts to the eight vocational SBB work processes.'])}
${go('evidence',`${tx(['Open bewijsindex','Open evidence index'])} ↗`,'text-link')}${tx(['Nog geen projecten toegevoegd.','No projects added yet.'])}
`; } +function work() { + return `01 / ${tx(['PROJECTARCHIEF','PROJECT ARCHIVE'])}
${tx(['Schoolprojecten, bekeken vanuit het probleem, de uitvoering en het beschikbare bewijs. De broncode blijft één klik verder.','School projects, through their problems, implementation, and available evidence. The source code is always one click away.'])}
PROJECT ${esc(p.number)} / CHALLENGE ${esc(p.challenge)}
${tx(p.intro)}
0${i+1}
${tx(body)}
04
${tx(['Dit zijn gevonden bronnen, geen goedgekeurde examenbewijzen. Documentinhoud en testresultaten moeten nog worden gecontroleerd.','These are located sources, not approved exam evidence. Document contents and test results still need review.'])}
05 / ${tx(['PERSOONLIJKE REFLECTIE','PERSONAL REFLECTION'])}
${tx(['Nog aan te vullen door Alvin: welke onderdelen heb ik zelf gemaakt, met wie werkte ik samen, welke feedback kreeg ik en wat zou ik anders doen?','To be completed by Alvin: which parts did I build myself, who did I work with, what feedback did I receive, and what would I do differently?'])}
02 / ${tx(['EXAMENPORTFOLIO','EXAM PORTFOLIO'])}
${tx(['Bronnen per werkproces. Een navigeerbare voorbereiding op mijn examen, met zichtbaar onderscheid tussen gevonden materiaal en wat nog ontbreekt.','Sources by work process. A navigable preparation for my exam, making the distinction between located material and missing evidence visible.'])}
${tx(['In opbouw. Koppelingen zijn voorlopig; aanwezigheid van code of een document bewijst nog geen beheersing. Persoonlijke bijdrage, resultaten en beoordeling moeten worden toegevoegd. Stem de definitieve bewijslast af met de examinator.','In progress. Mappings are provisional; code or a document alone does not demonstrate competence. Personal contributions, results, and assessment need to be added. Agree the final evidence requirements with the examiner.'])}
SBB / 25998 / 2024
${tx(['Deze index volgt de acht beroepsspecifieke werkprocessen uit het gekoppelde dossier. Generieke vakken, keuzedelen en VISTA-examenafspraken vallen buiten deze index. Engelse labels zijn eigen vertalingen.','This index follows the eight vocational work processes in the linked qualification. General subjects, electives, and VISTA exam arrangements are outside this index. English labels are informal translations.'])}
${ext(profile.qualification,tx(['Lees het officiële kwalificatiedossier','Read the official qualification document']),'text-link')}${tx(p.description)}
${found.length?`${tx(['Te controleren: inhoud, eigen bijdrage en geschiktheid voor het examen.','To verify: contents, personal contribution, and suitability for the exam.'])}
`:`03 / ${tx(['OVER MIJ','ABOUT ME'])}
${tx(['Software Developer in opleiding. Derdejaars bij VISTA college in Heerlen.','Software Developer in training. Third-year student at VISTA college in Heerlen.'])}
${tx(['Mijn schoolwerk loopt uiteen van websites en PHP-applicaties tot een magazijnsysteem en narrowcasting. Dit portfolio brengt de projecten en de bijbehorende bronnen bij elkaar.','My schoolwork ranges from websites and PHP applications to a warehouse system and narrowcasting. This portfolio brings those projects and their sources together.'])}
${tx(['Ik bouw dit portfolio voor mijn eindexamen. Daarna wil ik het verder gebruiken om mijn werk aan toekomstige werkgevers te laten zien.','I’m building this portfolio for my final exam. After that, I want to keep using it to show my work to future employers.'])}
${tx(['VERDER KIJKEN','TAKE A CLOSER LOOK'])}
${tx(['Een rechtstreeks contactadres en cv worden later toegevoegd.','A direct contact address and CV will be added later.'])}
${tx(['Deze pagina bestaat niet.','This page does not exist.'])}
${go('home',tx(['Terug naar het begin','Back to home']),'button')}`, `#about`. Unknown routes show a 404. Language is selected using `?lang=nl` or `?lang=en`.
+
+`header` and `footer` render shared navigation. `home` and `work` render project lists; `detail` renders a dossier. `processRow` derives evidence counts and links from every project's `evidence` array. Removing evidence automatically removes its process-index entries.
+
+At initial indexing there were three projects and twelve evidence entries in a single handwritten `content.js`. The homepage assumed at least one project, linked directly to `warehouse`, and displayed a fixed count. These assumptions were removed for content management. The first project by number is now featured; an empty portfolio is supported.
+
+Project IDs are stable route identifiers. Evidence paths are relative to `profile.school` at the pinned `revision`. Text pairs are `[Dutch, English]`. The existing design uses exactly three diagram nodes. Personal contribution and reflection copy is still shared placeholder text in `app.js`.
+
+## Exposure boundary
+
+Editing happens in local JSON files. The preview server has no write endpoint and binds to `127.0.0.1`. Production ships five static files, with no editor, login, database, or server process. All content included in a build is public: only put publishable material in these files. Publish `dist/`, not the repository root.
diff --git a/docs/docker-hosting.md b/docs/docker-hosting.md
new file mode 100644
index 0000000..9c9d245
--- /dev/null
+++ b/docs/docker-hosting.md
@@ -0,0 +1,77 @@
+# Proxmox Docker hosting
+
+Use a Linux guest with Docker Engine and the Docker Compose plugin installed. Copy this repository to the guest, or clone it after committing and pushing your changes. From the repository directory:
+
+```sh
+cp .env.example .env
+# Edit .env: set BIND_ADDRESS to the portfolio guest's LAN IP.
+docker compose up -d --build
+docker compose ps
+# Replace the example IP with the portfolio guest's LAN IP:
+curl -f http://192.168.1.50:8080/healthz
+```
+
+Docker validates content, runs tests and builds inside a Node build stage. Only static assets enter the Nginx runtime image. No Node installation, database or persistent volume is required on the guest. Configure the guest and Docker to start on boot; the service uses `restart: unless-stopped`.
+
+## Network access
+
+The default binding is `127.0.0.1:8080`, accessible only on the Docker guest. A reverse proxy running directly on that guest can forward to it.
+
+For access from your laptop or a reverse proxy on another machine, edit `.env` to use the guest's actual LAN IP:
+
+```dotenv
+BIND_ADDRESS=192.168.1.50
+PORTFOLIO_PORT=8080
+```
+
+Run `docker compose up -d` again, then open `http://192.168.1.50:8080` using your actual IP. Restrict port 8080 at the network/Proxmox firewall to the intended LAN or reverse proxy. Change `PORTFOLIO_PORT` if the port is already occupied.
+
+## Separate Nginx Proxy Manager box
+
+Your topology is: Internet → Nginx Proxy Manager (HTTPS) → portfolio guest LAN IP:8080 (HTTP). The portfolio container needs no certificate or domain configuration.
+
+In Nginx Proxy Manager, add a **Proxy Host** with these settings:
+
+| Setting | Value |
+| --- | --- |
+| Domain Names | Your portfolio domain, such as `portfolio.example.com` |
+| Scheme | `http` |
+| Forward Hostname / IP | The portfolio guest's LAN IP, such as `192.168.1.50` |
+| Forward Port | `8080`, or your chosen `PORTFOLIO_PORT` |
+| Access List | Publicly Accessible, for a public portfolio |
+| Cache Assets | Off, so content edits revalidate immediately |
+| Websockets Support | Off; this static site does not use WebSockets |
+| SSL Certificate | Select an existing matching certificate or request one |
+| Force SSL | On after the certificate is configured |
+
+Leave Advanced configuration and Custom Locations empty. Serve the portfolio at the domain root. Hash routes, project links and both languages work without rewrite rules. Nginx Proxy Manager is designed to act as the gateway and manage SSL; see its [official guide](https://nginxproxymanager.com/guide/).
+
+Use the portfolio guest's LAN address as the upstream, not `localhost`, the proxy box's IP or the Docker service name. Separate machines do not share the local Docker bridge network.
+
+Point your domain DNS at the public address used by Nginx Proxy Manager. Your router's public ports 80/443 should reach the proxy box. Do not forward public port 8080 to the portfolio guest. At the Proxmox/network firewall, allow inbound TCP 8080 to the portfolio guest from the proxy box's LAN IP and deny other sources. Binding to a LAN IP alone does not impose this source restriction. These firewall/DNS settings must be applied in your infrastructure; this repository does not configure them.
+
+From the proxy box, verify `curl -f http://192.168.1.50:8080/healthz` returns `ok` (substitute your IP). Then open the public HTTPS domain and test a project and language switch. If Nginx Proxy Manager returns 502, check the upstream IP, HTTP scheme, port, container status and firewall access from the proxy box.
+
+## Updates
+
+Edit the JSON source files locally, then sync the changed files to the guest, including removing deleted project files. With Git, commit/push locally and pull on the guest. Apply updates with:
+
+```sh
+docker compose up -d --build
+```
+
+Restarting alone does not import edited content; the files are baked into the image. Keep and back up the source checkout. Do not edit inside the container. To refresh base images, run `docker compose build --pull`, then `docker compose up -d`.
+
+## Operations and exposure
+
+```sh
+docker compose logs --tail=100 portfolio
+docker compose ps
+docker compose down
+```
+
+The container runs as the Nginx user with a read-only filesystem, dropped Linux capabilities and temporary memory-backed storage. The server exposes only the public website assets and `/healthz`; there is no admin or editing endpoint. Everything in the built content remains public. The development server is not used for hosting.
+
+The health check expects `/healthz` to return `ok`. The restart policy handles process exits; an unhealthy status alone does not restart the container. Compose settings follow the [Docker service reference](https://docs.docker.com/reference/compose-file/services/).
+
+Local content tests, static build and Compose configuration validation passed. The container could not be built or run locally because the Docker engine was unavailable. Nothing has been deployed to Proxmox.
diff --git a/docs/mobile-preview.png b/docs/mobile-preview.png
new file mode 100644
index 0000000..903c152
Binary files /dev/null and b/docs/mobile-preview.png differ
diff --git a/docs/preview.png b/docs/preview.png
new file mode 100644
index 0000000..d125505
Binary files /dev/null and b/docs/preview.png differ
diff --git a/docs/verification.md b/docs/verification.md
new file mode 100644
index 0000000..6148327
--- /dev/null
+++ b/docs/verification.md
@@ -0,0 +1,16 @@
+# Verification — 9 November 2026
+
+- `node --check app.js` passed.
+- `npm test`: both content integrity checks passed.
+- `npm run build` passed; static output is in `dist/`.
+- Local HTTP server returned 200.
+- All 15 referenced project/artifact paths exist in the inspected school repository snapshot.
+- Browser verified Dutch/English switching and preservation of the selected project.
+- Evidence filter opened the software-testing process and displayed its three source links.
+- Project navigation and keyboard skip link worked; skip retained the current route and focused the main region.
+- All seven main routes were checked at 320px in both languages without document-width overflow.
+- Homepage and project page inspected visually at mobile widths; homepage also inspected at 1440px. The English hero overflow found during inspection was fixed.
+- No browser console errors were observed in the checked session.
+- Preview saved in `docs/preview.png`.
+
+Limits: print/PDF layout has a dedicated stylesheet but was not rendered to a PDF in this pass. Docker deployment was not run. Linked DOCX contents were not reviewed. Source project tests were not executed. These checks validate the portfolio implementation, not the completeness or acceptance of exam evidence.
diff --git a/package.json b/package.json
index 344e300..d82c911 100644
--- a/package.json
+++ b/package.json
@@ -5,7 +5,9 @@
"scripts": {
"dev": "node scripts/serve.mjs",
"build": "node scripts/build.mjs",
- "test": "node --test tests/*.test.mjs"
+ "test": "node scripts/content.mjs && node --test tests/*.test.mjs",
+ "content": "node scripts/content.mjs",
+ "project:add": "node scripts/content.mjs add"
},
"engines": { "node": ">=22" }
}
diff --git a/scripts/build.mjs b/scripts/build.mjs
index fe796c3..7154171 100644
--- a/scripts/build.mjs
+++ b/scripts/build.mjs
@@ -1,4 +1,7 @@
import { mkdir, copyFile } from 'node:fs/promises';
+import { writeFile } from 'node:fs/promises';
+import { compileContent } from './content.mjs';
+await writeFile(new URL('../content.js', import.meta.url), await compileContent());
await mkdir('dist', { recursive: true });
for (const file of ['index.html', 'styles.css', 'app.js', 'content.js', 'favicon.svg']) {
await copyFile(file, `dist/${file}`);
diff --git a/scripts/content.mjs b/scripts/content.mjs
new file mode 100644
index 0000000..0e0f7c5
--- /dev/null
+++ b/scripts/content.mjs
@@ -0,0 +1,53 @@
+import { readdir, readFile, writeFile } from 'node:fs/promises';
+import { pathToFileURL } from 'node:url';
+
+const root = new URL('../', import.meta.url);
+const readJSON = async path => JSON.parse(await readFile(new URL(path, root), 'utf8'));
+const pairs = ['kind', 'title', 'name', 'intro', 'context', 'implementation', 'decisions'];
+export function validateProjects(projects, processes) {
+ const ids = new Set();
+ const codes = new Set(processes.map(p => p.code));
+ const require = (ok, message) => { if (!ok) throw new Error(message); };
+ const pair = value => Array.isArray(value) && value.length === 2 && value.every(v => typeof v === 'string' && v.trim());
+ const path = value => typeof value === 'string' && value.length > 0 && !value.startsWith('/') && !value.split('/').some(p => p === '..' || p === '.');
+ const mapping = value => Array.isArray(value) && value.every(c => codes.has(c));
+ for (const p of projects) {
+ require(/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(p.id) && !ids.has(p.id), `Invalid or duplicate project ID: ${p.id}`);
+ ids.add(p.id);
+ for (const key of pairs) require(pair(p[key]), `${p.id}.${key}: provide Dutch and English text`);
+ for (const key of ['number', 'challenge']) require(typeof p[key] === 'string' && p[key].trim(), `${p.id}.${key}: required text`);
+ for (const key of ['stack', 'nodes']) require(Array.isArray(p[key]) && p[key].length > 0 && p[key].every(v => typeof v === 'string' && v.trim()), `${p.id}.${key}: provide text entries`);
+ require(p.nodes.length === 3, `${p.id}.nodes: provide three diagram labels`);
+ require(path(p.path), `${p.id}.path: provide a repository-relative path`);
+ require(mapping(p.codes), `${p.id}.codes: unknown process code`);
+ require(Array.isArray(p.evidence), `${p.id}.evidence: expected an array`);
+ for (const e of p.evidence) {
+ require(pair(e.label) && path(e.path) && typeof e.type === 'string' && e.type.trim() && mapping(e.codes) && (e.directory === undefined || typeof e.directory === 'boolean'), `${p.id}: invalid evidence item`);
+ }
+ }
+}
+export async function compileContent() {
+ const settings = await readJSON('content/settings.json');
+ const files = (await readdir(new URL('content/projects/', root))).filter(f => f.endsWith('.json')).sort();
+ const projects = await Promise.all(files.map(f => readJSON(`content/projects/${f}`)));
+ projects.sort((a, b) => a.number.localeCompare(b.number, undefined, { numeric: true }));
+ validateProjects(projects, settings.processes);
+ return '// Generated from content/ by npm run content. Edit the JSON source files.\n' +
+ Object.entries({ ...settings, projects }).map(([key, value]) => `export const ${key} = ${JSON.stringify(value, null, 2)};`).join('\n') +
+ '\nexport const source = (path, directory = false) => `${profile.school}/${directory ? "tree" : "blob"}/${revision}/${path.split("/").map(encodeURIComponent).join("/")}`;\n';
+}
+if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
+ const [command, id] = process.argv.slice(2);
+ if (command === 'add') {
+ if (!/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(id || '')) throw new Error('Usage: npm run project:add -- my-project');
+ const files = (await readdir(new URL('content/projects/', root))).filter(f => f.endsWith('.json'));
+ const existing = await Promise.all(files.map(f => readJSON(`content/projects/${f}`)));
+ const p = { id, number: String(Math.max(0, ...existing.map(p => Number(p.number) || 0)) + 1).padStart(2, '0'), challenge: '—' };
+ for (const key of pairs) p[key] = [key === 'name' ? id : 'Nog aanvullen', key === 'name' ? id : 'To be completed'];
+ Object.assign(p, { stack: ['To be completed'], codes: [], path: 'projects', nodes: ['Input', 'Application', 'Output'], evidence: [] });
+ await writeFile(new URL(`content/projects/${id}.json`, root), JSON.stringify(p, null, 2) + '\n', { flag: 'wx' });
+ console.log(`Created content/projects/${id}.json — replace the placeholder text before publishing.`);
+ }
+ await writeFile(new URL('content.js', root), await compileContent());
+ console.log('Validated and generated content.js');
+}
diff --git a/scripts/serve.mjs b/scripts/serve.mjs
index a89d74e..06e7161 100644
--- a/scripts/serve.mjs
+++ b/scripts/serve.mjs
@@ -1,5 +1,6 @@
import { createServer } from 'node:http';
import { readFile } from 'node:fs/promises';
+import { compileContent } from './content.mjs';
const port = Number(process.env.PORT || 4173);
const files = new Map([['/', 'index.html'], ['/index.html', 'index.html'], ['/styles.css', 'styles.css'], ['/app.js', 'app.js'], ['/content.js', 'content.js'], ['/favicon.svg', 'favicon.svg']]);
const mime = { html: 'text/html', css: 'text/css', js: 'text/javascript', svg: 'image/svg+xml' };
@@ -7,7 +8,7 @@ createServer(async (req, res) => {
const file = files.get(new URL(req.url, 'http://localhost').pathname);
if (!file) { res.writeHead(404); return res.end('Not found'); }
try {
- const body = await readFile(new URL(`../${file}`, import.meta.url));
+ const body = file === 'content.js' ? await compileContent() : await readFile(new URL(`../${file}`, import.meta.url));
res.writeHead(200, { 'Content-Type': `${mime[file.split('.').pop()]}; charset=utf-8`, 'Cache-Control': 'no-cache', 'X-Content-Type-Options': 'nosniff' });
res.end(body);
} catch { res.writeHead(500); res.end('Unable to read file'); }
diff --git a/styles.css b/styles.css
index 50fcb54..effc136 100644
--- a/styles.css
+++ b/styles.css
@@ -1,3 +1,1226 @@
-@import url('');
-:root{color-scheme:dark;--bg:#111413;--panel:#181c1a;--text:#e7e9e3;--muted:#a0aaa2;--line:#303831;--accent:#c4dda3;--mono:'Cascadia Code','SFMono-Regular',Consolas,monospace;font-family:Inter,'Segoe UI',Arial,sans-serif;font-synthesis:none}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:var(--bg);color:var(--text);font-size:16px;line-height:1.65}a{color:inherit;text-decoration:none}button,select{font:inherit}button,a,select{-webkit-tap-highlight-color:transparent}button{cursor:pointer}a:focus-visible,button:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:6px}button{color:inherit}a:hover{color:var(--accent)}main:focus{outline:none}header{border-bottom:1px solid var(--line)}.header-inner{max-width:1400px;margin:auto;min-height:96px;padding:0 64px;display:flex;align-items:center;justify-content:space-between;gap:32px}.brand{display:flex;align-items:center;gap:20px}.monogram{font-weight:750;font-size:35px;letter-spacing:-3px}.monogram span{color:var(--accent)}.brand-name{font-size:13px;font-weight:550}.header-inner nav{display:flex;gap:34px;font-size:14px;margin-left:auto;margin-right:50px}.header-inner nav a{color:var(--muted);position:relative;padding:10px 0}.header-inner nav a[aria-current]{color:var(--text)}.header-inner nav a[aria-current]:after{content:'';position:absolute;bottom:0;left:0;width:16px;height:2px;background:var(--accent)}.languages{display:flex;border:1px solid var(--line);padding:3px;border-radius:4px}.languages button{border:0;background:none;padding:5px 8px;font:11px var(--mono);color:var(--muted)}.languages button[aria-pressed=true]{background:#30392e;color:var(--accent)}main{max-width:1400px;margin:auto;padding:0 64px}.mono,.eyebrow{font-family:var(--mono);font-size:11px;letter-spacing:1.3px}.eyebrow{color:var(--accent);margin:0 0 24px;display:flex;align-items:center;gap:10px}.eyebrow span:not(.dot){color:var(--muted)}.dot{display:inline-block;flex-shrink:0;width:6px;height:6px;background:var(--accent);border-radius:50%}.muted{color:var(--muted)}h1,h2,h3,p{margin-top:0}h1{font-size:clamp(48px,6.8vw,94px);line-height:1.06;letter-spacing:-5px;font-weight:500;margin-bottom:28px}h1 em{font-style:normal;color:var(--accent)}h2{font-size:34px;line-height:1.2;letter-spacing:-1.2px;font-weight:500;margin-bottom:24px}h3{font-size:29px;letter-spacing:-.8px;font-weight:500;line-height:1.25;margin:0 0 14px}p{color:var(--muted)}.hero{display:grid;grid-template-columns:1.1fr 1fr;gap:70px;align-items:center;padding:86px 0 88px}.hero-intro{max-width:440px;font-size:16px;line-height:1.8;margin:28px 0 30px}.actions{display:flex;align-items:center;gap:24px;flex-wrap:wrap}.button{display:inline-flex;align-items:center;justify-content:space-between;gap:32px;border:1px solid var(--line);padding:12px 18px;border-radius:3px;background:transparent;font-size:13px;font-weight:550}.button.primary{background:var(--accent);color:#1d2819;border-color:var(--accent)}.button:hover{background:#2a3427;color:var(--text)}.text-link{font-size:13px;border-bottom:1px solid #626f56;padding-bottom:5px;display:inline-block}.edition{display:flex;justify-content:space-between;color:var(--muted);padding-bottom:16px}.hero-aside{padding-top:35px}.system{background:var(--panel);border:1px solid var(--line);overflow:hidden;position:relative;min-height:230px;display:flex;flex-direction:column;background-image:radial-gradient(#3b443a 0.7px,transparent .7px);background-size:19px 19px}.system.large{min-height:340px}.system-top,.system-bottom{display:flex;justify-content:space-between;gap:15px;padding:18px 22px;font-size:9px;color:var(--muted)}.system-top{border-bottom:1px solid #30383170;align-items:center;background:#181c1ad9}.system-bottom{margin-top:auto;background:#181c1ad9}.diagram{display:flex;align-items:center;justify-content:center;flex:1;padding:38px 24px}.node{display:flex;flex-direction:column;align-items:center;gap:13px;position:relative;background:#1c241e;border:1px solid #56634e;padding:17px 12px;min-width:92px;font:11px var(--mono);color:var(--accent)}.node small{position:absolute;top:-8px;left:9px;background:#1c241e;padding:0 5px;font-size:8px}.node-icon{font-size:25px;line-height:1}.wire{width:35px;height:1px;background:#80966c;position:relative}.wire:after{content:'';border:3px solid transparent;border-left-color:#80966c;position:absolute;right:-2px;top:-3px}.narrowcasting .node{color:#b4cddd;border-color:#566773;background:#1d262b}.narrowcasting .wire{background:#758e9d}.refactoring .node{color:#d5c3a9;border-color:#70624e;background:#28241e}.refactoring .wire{background:#a49276}.aside-caption{display:flex;gap:19px;padding:24px 0;border-bottom:1px solid var(--line);align-items:center}.aside-caption>.mono{color:var(--accent)}.aside-caption strong{font-size:14px;font-weight:500}.aside-caption p{margin:5px 0 0;font-size:12px}.circle-link{border:1px solid var(--line);border-radius:50%;width:34px;height:34px;display:grid;place-items:center;margin-left:auto}.study-stamp{display:flex;gap:16px;margin-top:24px;font-size:11px;color:var(--muted)}.study-stamp>span:last-child{margin-left:auto}.section{padding:60px 0 65px;border-top:1px solid var(--line)}.section-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:22px}.section-heading .eyebrow{margin-bottom:16px}.section-heading h2{margin-bottom:16px}.project-row{display:grid;grid-template-columns:50px 1fr 160px;gap:20px;align-items:start;padding:33px 0;border-bottom:1px solid var(--line)}.project-number{color:var(--muted);padding-top:5px}.project-copy .eyebrow{font-size:10px;margin-bottom:14px}.project-copy p:not(.eyebrow){font-size:14px;max-width:650px;margin-bottom:20px}.tags{display:flex;gap:8px;flex-wrap:wrap}.tag{font:10px var(--mono);border:1px solid var(--line);border-radius:3px;padding:5px 8px;color:var(--muted)}.row-link{display:flex;justify-content:space-between;gap:12px;align-self:center;font-size:12px}.row-link span:last-child{font-size:23px;color:var(--accent)}.exam-callout{margin:15px 0 90px;padding:45px;border:1px solid var(--line);display:grid;grid-template-columns:1.5fr 1fr;gap:80px;background:#151a16}.exam-callout p:not(.eyebrow){font-size:14px;max-width:600px}.index-preview{display:flex;flex-direction:column;justify-content:center;gap:0;font:11px var(--mono)}.index-preview>div{display:flex;align-items:center;gap:22px;border-bottom:1px solid var(--line);padding:13px 0}.index-preview>div>span:first-child{color:var(--muted);font-size:9px}.index-preview strong{font-weight:400;letter-spacing:2px}.small-line{height:3px;background:#71855c;width:38px;margin-left:auto}.index-preview>div:nth-child(2) .small-line{width:62px}.index-preview>div:nth-child(3) .small-line{width:85px}footer{max-width:1272px;margin:auto;border-top:1px solid var(--line);padding:32px 0;display:flex;align-items:center;justify-content:space-between;gap:30px}footer p{font-size:12px;margin:10px 0 0}.footer-links{display:flex;gap:25px;font-size:12px}footer>.mono{font-size:9px}.skip{position:fixed;top:-100px;left:15px;padding:12px;background:var(--accent);color:#111;z-index:100}.skip:focus{top:15px}.page-heading{padding:70px 0 55px;max-width:920px}.page-heading h1{font-size:clamp(42px,6vw,80px);letter-spacing:-3px}.page-heading>p:not(.eyebrow){max-width:680px;font-size:17px}.work-list{border-top:0;padding-top:0;display:grid;gap:50px}.work-list .system{max-width:100%}.work-list .diagram{max-width:700px;width:100%;margin:auto}.work-list .node{min-width:160px}.work-list .wire{width:90px}.archive-link{margin-bottom:75px}.back-link{font-size:12px;color:var(--muted);display:inline-block;margin-bottom:35px}.accent{color:var(--accent)}.project-heading{max-width:1000px}.project-layout{display:grid;grid-template-columns:240px 1fr;gap:80px;padding:65px 0 85px}.project-meta{font-size:13px}.project-meta dt{color:var(--muted);font-size:11px;margin-top:24px}.project-meta dd{margin:5px 0 0}.project-meta .text-link{margin-top:25px}.project-story{max-width:760px}.project-story section{margin-bottom:50px}.project-story .eyebrow{margin-bottom:15px}.project-story h2{font-size:29px}.project-story p{font-size:15px}.evidence-links{border-top:1px solid var(--line);margin-top:25px}.evidence-links>a,.evidence-entry{border-bottom:1px solid var(--line);padding:17px 0;font-size:13px}.evidence-links>a,.evidence-entry>a:first-child{display:flex;justify-content:space-between;gap:18px}.evidence-links small{font-size:9px;display:inline-block;min-width:55px;color:var(--accent)}.reflection{border:1px solid var(--line);padding:28px;background:var(--panel)}.reflection p:last-child{margin-bottom:0}.evidence-toolbar{display:flex;justify-content:space-between;gap:20px;align-items:end;margin-bottom:28px}.evidence-toolbar label{display:block;font:11px var(--mono);margin-bottom:12px;color:var(--muted)}select{background:var(--panel);border:1px solid var(--line);border-radius:3px;color:var(--text);padding:12px;font-size:13px;max-width:100%}.notice{display:flex;gap:15px;border-left:2px solid #af9564;background:#1f211b;padding:20px 24px;margin-bottom:30px}.notice p{font-size:13px;margin:0;max-width:900px;color:#c0c2b2}.status-dot{height:6px;width:6px;border-radius:50%;background:#c3ad80;flex-shrink:0;margin-top:8px}.process{border-bottom:1px solid var(--line)}.process:first-child{border-top:1px solid var(--line)}.process summary{list-style:none;display:grid;grid-template-columns:130px 1fr 110px 20px;gap:20px;align-items:center;padding:25px 0;cursor:pointer}.process summary::-webkit-details-marker{display:none}.process-code{font-size:11px;color:var(--muted);letter-spacing:0}.process-title{font-size:18px}.evidence-status{font:10px var(--mono)}.located{color:var(--accent)}.missing{color:#c9b48e}.expand{font-size:22px;color:var(--muted)}details[open] .expand{transform:rotate(45deg)}.process-content{padding:0 0 30px 150px;max-width:960px}.process-content>p{font-size:14px}.evidence-project{font-size:11px;color:var(--muted);margin:8px 0 0 55px;display:inline-block}.pending{margin-top:20px;font-size:12px!important}.empty-state{border:1px dashed #51594c;color:var(--muted);padding:22px;font-size:13px}.source-note{margin:50px 0 70px;max-width:800px;font-size:13px}.source-note .mono{color:var(--accent)}.about-grid{display:grid;grid-template-columns:1.3fr 1fr;gap:100px;border-top:1px solid var(--line);padding:60px 0}.about-grid p{font-size:15px}.profile-facts>div{border-bottom:1px solid var(--line);padding:19px 0;display:flex;justify-content:space-between;gap:25px;font-size:13px}.profile-facts span{color:var(--muted)}.profile-facts strong{font-weight:500}.contact-section{border-top:1px solid var(--line);padding:60px 0 80px}.contact-section>p:last-child{font-size:12px;margin-top:24px}
-@media(min-width:1500px){.hero{padding-top:100px;padding-bottom:100px}}@media(max-width:1100px){.header-inner{padding:0 32px}.hero{gap:35px}main{padding:0 32px}footer{margin:0 32px}.node{min-width:75px;font-size:10px}.wire{width:22px}.diagram{padding:35px 18px}.hero h1{font-size:68px}.hero .actions{gap:17px}.brand-name{display:none}.exam-callout{gap:40px}.project-layout{gap:45px;grid-template-columns:200px 1fr}.study-stamp{gap:10px}}@media(max-width:760px){.header-inner{padding:0 22px;min-height:78px;gap:16px}.header-inner nav{gap:18px;margin:0 auto;font-size:12px}.monogram{font-size:28px}main{padding:0 22px}.hero{grid-template-columns:1fr;padding:48px 0;gap:20px}.hero h1{font-size:65px;letter-spacing:-3.5px}.hero-intro{max-width:530px}.hero-aside{padding-top:10px}.system.large{min-height:280px}.hero .node{min-width:95px}.hero .wire{width:35px}.section{padding:42px 0}.section-heading{align-items:end}.section-heading>.mono{display:none}h2{font-size:29px}.project-row{grid-template-columns:28px 1fr;gap:14px;padding:28px 0}.row-link{grid-column:2;justify-content:flex-start;gap:20px}.project-copy h3{font-size:25px}.project-copy .eyebrow{display:block;line-height:2}.exam-callout{padding:26px;grid-template-columns:1fr;gap:20px;margin-bottom:50px}.index-preview{display:none}footer{margin:0 22px;flex-wrap:wrap;gap:24px}.footer-links{gap:18px}footer>.mono{width:100%}.page-heading{padding:45px 0 35px}.page-heading h1{font-size:52px;letter-spacing:-2px}.page-heading>p:not(.eyebrow){font-size:15px}.work-list .node{min-width:90px}.work-list .wire{width:30px}.project-layout{grid-template-columns:1fr;gap:45px;padding-top:35px}.project-meta dl{display:grid;grid-template-columns:1fr 1fr;gap:12px}.project-meta dt{margin:0}.project-meta dd{margin:0}.project-story h2{font-size:26px}.evidence-toolbar{align-items:stretch;flex-wrap:wrap}.evidence-toolbar>div{width:100%}select{width:100%}.process summary{grid-template-columns:1fr 90px 15px;gap:8px;padding:20px 0}.process-code{grid-column:1/-1}.process-title{font-size:16px}.process-content{padding-left:0}.notice{padding:17px}.about-grid{grid-template-columns:1fr;gap:25px;padding:35px 0}.contact-section{padding-top:40px}.evidence-links small{min-width:42px}}@media(max-width:380px){.header-inner{padding:0 14px;gap:10px}.header-inner nav{gap:12px}.languages button{padding:5px}.hero h1{font-size:57px}.hero .node{min-width:75px}.hero .wire{width:20px}.system-top,.system-bottom{padding:14px;font-size:8px}.diagram{padding:35px 12px}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*{transition:none!important}}@media print{:root{color-scheme:light;--bg:white;--text:#111;--muted:#444;--line:#bbb;--accent:#314826}body{background:white;color:#111;font-size:11pt}header,footer,.evidence-toolbar,.skip,.expand{display:none!important}main{padding:0;max-width:none}.page-heading{padding:0 0 20px}.page-heading h1{font-size:34pt;letter-spacing:-1px}.notice{background:none}.notice p{color:#333}.process summary{padding:15px 0;grid-template-columns:110px 1fr 100px}.process-content{padding-left:0}.process{break-inside:avoid}.evidence-status{color:#333}.process-title{font-size:14pt}.source-note{margin-bottom:0}.evidence-links a{overflow-wrap:anywhere}.evidence-links a[href^=http]:after{content:' (' attr(href) ')';font-size:8pt;display:block;max-width:75%;color:#444}.evidence-links>a,.evidence-entry>a:first-child{display:block}.system{background:none}.reflection{background:none}}
+:root{
+ color-scheme:dark;
+ --bg:#111413;
+ --panel:#181c1a;
+ --text:#e7e9e3;
+ --muted:#a0aaa2;
+ --line:#303831;
+ --accent:#c4dda3;
+ --mono:'Cascadia Code','SFMono-Regular',Consolas,monospace;
+ font-family:Inter,'Segoe UI',Arial,sans-serif;
+ font-synthesis:none
+}
+*{
+ box-sizing:border-box
+}
+html{
+ scroll-behavior:smooth
+}
+body{
+ margin:0;
+ background:var(--bg);
+ color:var(--text);
+ font-size:16px;
+ line-height:1.65
+}
+a{
+ color:inherit;
+ text-decoration:none
+}
+button,select{
+ font:inherit
+}
+button,a,select{
+ -webkit-tap-highlight-color:transparent
+}
+button{
+ cursor:pointer
+}
+a:focus-visible,button:focus-visible,select:focus-visible,summary:focus-visible{
+ outline:2px solid var(--accent);
+ outline-offset:6px
+}
+button{
+ color:inherit
+}
+a:hover{
+ color:var(--accent)
+}
+main:focus{
+ outline:none
+}
+header{
+ border-bottom:1px solid var(--line)
+}
+.header-inner{
+ max-width:1400px;
+ margin:auto;
+ min-height:96px;
+ padding:0 64px;
+ display:flex;
+ align-items:center;
+ justify-content:space-between;
+ gap:32px
+}
+.brand{
+ display:flex;
+ align-items:center;
+ gap:20px
+}
+.monogram{
+ font-weight:750;
+ font-size:35px;
+ letter-spacing:-3px
+}
+.monogram span{
+ color:var(--accent)
+}
+.brand-name{
+ font-size:13px;
+ font-weight:550
+}
+.header-inner nav{
+ display:flex;
+ gap:34px;
+ font-size:14px;
+ margin-left:auto;
+ margin-right:50px
+}
+.header-inner nav a{
+ color:var(--muted);
+ position:relative;
+ padding:10px 0
+}
+.header-inner nav a[aria-current]{
+ color:var(--text)
+}
+.header-inner nav a[aria-current]:after{
+ content:'';
+ position:absolute;
+ bottom:0;
+ left:0;
+ width:16px;
+ height:2px;
+ background:var(--accent)
+}
+.languages{
+ display:flex;
+ border:1px solid var(--line);
+ padding:3px;
+ border-radius:4px
+}
+.languages button{
+ border:0;
+ background:none;
+ padding:5px 8px;
+ font:11px var(--mono);
+ color:var(--muted)
+}
+.languages button[aria-pressed=true]{
+ background:#30392e;
+ color:var(--accent)
+}
+main{
+ max-width:1400px;
+ margin:auto;
+ padding:0 64px
+}
+.mono,.eyebrow{
+ font-family:var(--mono);
+ font-size:11px;
+ letter-spacing:1.3px
+}
+.eyebrow{
+ color:var(--accent);
+ margin:0 0 24px;
+ display:flex;
+ align-items:center;
+ gap:10px
+}
+.eyebrow span:not(.dot){
+ color:var(--muted)
+}
+.dot{
+ display:inline-block;
+ flex-shrink:0;
+ width:6px;
+ height:6px;
+ background:var(--accent);
+ border-radius:50%
+}
+.muted{
+ color:var(--muted)
+}
+h1,h2,h3,p{
+ margin-top:0
+}
+h1{
+ font-size:clamp(48px,6.8vw,94px);
+ line-height:1.06;
+ letter-spacing:-5px;
+ font-weight:500;
+ margin-bottom:28px
+}
+h1 em{
+ font-style:normal;
+ color:var(--accent)
+}
+h2{
+ font-size:34px;
+ line-height:1.2;
+ letter-spacing:-1.2px;
+ font-weight:500;
+ margin-bottom:24px
+}
+h3{
+ font-size:29px;
+ letter-spacing:-.8px;
+ font-weight:500;
+ line-height:1.25;
+ margin:0 0 14px
+}
+p{
+ color:var(--muted)
+}
+.hero{
+ display:grid;
+ grid-template-columns:1.1fr 1fr;
+ gap:70px;
+ align-items:center;
+ padding:86px 0 88px
+}
+.hero-intro{
+ max-width:440px;
+ font-size:16px;
+ line-height:1.8;
+ margin:28px 0 30px
+}
+.actions{
+ display:flex;
+ align-items:center;
+ gap:24px;
+ flex-wrap:wrap
+}
+.button{
+ display:inline-flex;
+ align-items:center;
+ justify-content:space-between;
+ gap:32px;
+ border:1px solid var(--line);
+ padding:12px 18px;
+ border-radius:3px;
+ background:transparent;
+ font-size:13px;
+ font-weight:550
+}
+.button.primary{
+ background:var(--accent);
+ color:#1d2819;
+ border-color:var(--accent)
+}
+.button:hover{
+ background:#2a3427;
+ color:var(--text)
+}
+.text-link{
+ font-size:13px;
+ border-bottom:1px solid #626f56;
+ padding-bottom:5px;
+ display:inline-block
+}
+.edition{
+ display:flex;
+ justify-content:space-between;
+ color:var(--muted);
+ padding-bottom:16px
+}
+.hero-aside{
+ padding-top:35px
+}
+.system{
+ background:var(--panel);
+ border:1px solid var(--line);
+ overflow:hidden;
+ position:relative;
+ min-height:230px;
+ display:flex;
+ flex-direction:column;
+ background-image:radial-gradient(#3b443a 0.7px,transparent .7px);
+ background-size:19px 19px
+}
+.system.large{
+ min-height:340px
+}
+.system-top,.system-bottom{
+ display:flex;
+ justify-content:space-between;
+ gap:15px;
+ padding:18px 22px;
+ font-size:9px;
+ color:var(--muted)
+}
+.system-top{
+ border-bottom:1px solid #30383170;
+ align-items:center;
+ background:#181c1ad9
+}
+.system-bottom{
+ margin-top:auto;
+ background:#181c1ad9
+}
+.diagram{
+ display:flex;
+ align-items:center;
+ justify-content:center;
+ flex:1;
+ padding:38px 24px
+}
+.node{
+ display:flex;
+ flex-direction:column;
+ align-items:center;
+ gap:13px;
+ position:relative;
+ background:#1c241e;
+ border:1px solid #56634e;
+ padding:17px 12px;
+ min-width:92px;
+ font:11px var(--mono);
+ color:var(--accent)
+}
+.node small{
+ position:absolute;
+ top:-8px;
+ left:9px;
+ background:#1c241e;
+ padding:0 5px;
+ font-size:8px
+}
+.node-icon{
+ font-size:25px;
+ line-height:1
+}
+.wire{
+ width:35px;
+ height:1px;
+ background:#80966c;
+ position:relative
+}
+.wire:after{
+ content:'';
+ border:3px solid transparent;
+ border-left-color:#80966c;
+ position:absolute;
+ right:-2px;
+ top:-3px
+}
+.narrowcasting .node{
+ color:#b4cddd;
+ border-color:#566773;
+ background:#1d262b
+}
+.narrowcasting .wire{
+ background:#758e9d
+}
+.refactoring .node{
+ color:#d5c3a9;
+ border-color:#70624e;
+ background:#28241e
+}
+.refactoring .wire{
+ background:#a49276
+}
+.aside-caption{
+ display:flex;
+ gap:19px;
+ padding:24px 0;
+ border-bottom:1px solid var(--line);
+ align-items:center
+}
+.aside-caption>.mono{
+ color:var(--accent)
+}
+.aside-caption strong{
+ font-size:14px;
+ font-weight:500
+}
+.aside-caption p{
+ margin:5px 0 0;
+ font-size:12px
+}
+.circle-link{
+ border:1px solid var(--line);
+ border-radius:50%;
+ width:34px;
+ height:34px;
+ display:grid;
+ place-items:center;
+ margin-left:auto
+}
+.study-stamp{
+ display:flex;
+ gap:16px;
+ margin-top:24px;
+ font-size:11px;
+ color:var(--muted)
+}
+.study-stamp>span:last-child{
+ margin-left:auto
+}
+.section{
+ padding:60px 0 65px;
+ border-top:1px solid var(--line)
+}
+.section-heading{
+ display:flex;
+ justify-content:space-between;
+ align-items:center;
+ margin-bottom:22px
+}
+.section-heading .eyebrow{
+ margin-bottom:16px
+}
+.section-heading h2{
+ margin-bottom:16px
+}
+.project-row{
+ display:grid;
+ grid-template-columns:50px 1fr 160px;
+ gap:20px;
+ align-items:start;
+ padding:33px 0;
+ border-bottom:1px solid var(--line)
+}
+.project-number{
+ color:var(--muted);
+ padding-top:5px
+}
+.project-copy .eyebrow{
+ font-size:10px;
+ margin-bottom:14px
+}
+.project-copy p:not(.eyebrow){
+ font-size:14px;
+ max-width:650px;
+ margin-bottom:20px
+}
+.tags{
+ display:flex;
+ gap:8px;
+ flex-wrap:wrap
+}
+.tag{
+ font:10px var(--mono);
+ border:1px solid var(--line);
+ border-radius:3px;
+ padding:5px 8px;
+ color:var(--muted)
+}
+.row-link{
+ display:flex;
+ justify-content:space-between;
+ gap:12px;
+ align-self:center;
+ font-size:12px
+}
+.row-link span:last-child{
+ font-size:23px;
+ color:var(--accent)
+}
+.exam-callout{
+ margin:15px 0 90px;
+ padding:45px;
+ border:1px solid var(--line);
+ display:grid;
+ grid-template-columns:1.5fr 1fr;
+ gap:80px;
+ background:#151a16
+}
+.exam-callout p:not(.eyebrow){
+ font-size:14px;
+ max-width:600px
+}
+.index-preview{
+ display:flex;
+ flex-direction:column;
+ justify-content:center;
+ gap:0;
+ font:11px var(--mono)
+}
+.index-preview>div{
+ display:flex;
+ align-items:center;
+ gap:22px;
+ border-bottom:1px solid var(--line);
+ padding:13px 0
+}
+.index-preview>div>span:first-child{
+ color:var(--muted);
+ font-size:9px
+}
+.index-preview strong{
+ font-weight:400;
+ letter-spacing:2px
+}
+.small-line{
+ height:3px;
+ background:#71855c;
+ width:38px;
+ margin-left:auto
+}
+.index-preview>div:nth-child(2) .small-line{
+ width:62px
+}
+.index-preview>div:nth-child(3) .small-line{
+ width:85px
+}
+footer{
+ max-width:1272px;
+ margin:auto;
+ border-top:1px solid var(--line);
+ padding:32px 0;
+ display:flex;
+ align-items:center;
+ justify-content:space-between;
+ gap:30px
+}
+footer p{
+ font-size:12px;
+ margin:10px 0 0
+}
+.footer-links{
+ display:flex;
+ gap:25px;
+ font-size:12px
+}
+footer>.mono{
+ font-size:9px
+}
+.skip{
+ position:fixed;
+ top:-100px;
+ left:15px;
+ padding:12px;
+ background:var(--accent);
+ color:#111;
+ z-index:100
+}
+.skip:focus{
+ top:15px
+}
+.page-heading{
+ padding:70px 0 55px;
+ max-width:920px
+}
+.page-heading h1{
+ font-size:clamp(42px,6vw,80px);
+ letter-spacing:-3px
+}
+.page-heading>p:not(.eyebrow){
+ max-width:680px;
+ font-size:17px
+}
+.work-list{
+ border-top:0;
+ padding-top:0;
+ display:grid;
+ gap:50px
+}
+.work-list .system{
+ max-width:100%
+}
+.work-list .diagram{
+ max-width:700px;
+ width:100%;
+ margin:auto
+}
+.work-list .node{
+ min-width:160px
+}
+.work-list .wire{
+ width:90px
+}
+.archive-link{
+ margin-bottom:75px
+}
+.back-link{
+ font-size:12px;
+ color:var(--muted);
+ display:inline-block;
+ margin-bottom:35px
+}
+.accent{
+ color:var(--accent)
+}
+.project-heading{
+ max-width:1000px
+}
+.project-layout{
+ display:grid;
+ grid-template-columns:240px 1fr;
+ gap:80px;
+ padding:65px 0 85px
+}
+.project-meta{
+ font-size:13px
+}
+.project-meta dt{
+ color:var(--muted);
+ font-size:11px;
+ margin-top:24px
+}
+.project-meta dd{
+ margin:5px 0 0
+}
+.project-meta .text-link{
+ margin-top:25px
+}
+.project-story{
+ max-width:760px
+}
+.project-story section{
+ margin-bottom:50px
+}
+.project-story .eyebrow{
+ margin-bottom:15px
+}
+.project-story h2{
+ font-size:29px
+}
+.project-story p{
+ font-size:15px
+}
+.evidence-links{
+ border-top:1px solid var(--line);
+ margin-top:25px
+}
+.evidence-links>a,.evidence-entry{
+ border-bottom:1px solid var(--line);
+ padding:17px 0;
+ font-size:13px
+}
+.evidence-links>a,.evidence-entry>a:first-child{
+ display:flex;
+ justify-content:space-between;
+ gap:18px
+}
+.evidence-links small{
+ font-size:9px;
+ display:inline-block;
+ min-width:55px;
+ color:var(--accent)
+}
+.reflection{
+ border:1px solid var(--line);
+ padding:28px;
+ background:var(--panel)
+}
+.reflection p:last-child{
+ margin-bottom:0
+}
+.evidence-toolbar{
+ display:flex;
+ justify-content:space-between;
+ gap:20px;
+ align-items:end;
+ margin-bottom:28px
+}
+.evidence-toolbar label{
+ display:block;
+ font:11px var(--mono);
+ margin-bottom:12px;
+ color:var(--muted)
+}
+select{
+ background:var(--panel);
+ border:1px solid var(--line);
+ border-radius:3px;
+ color:var(--text);
+ padding:12px;
+ font-size:13px;
+ max-width:100%
+}
+.notice{
+ display:flex;
+ gap:15px;
+ border-left:2px solid #af9564;
+ background:#1f211b;
+ padding:20px 24px;
+ margin-bottom:30px
+}
+.notice p{
+ font-size:13px;
+ margin:0;
+ max-width:900px;
+ color:#c0c2b2
+}
+.status-dot{
+ height:6px;
+ width:6px;
+ border-radius:50%;
+ background:#c3ad80;
+ flex-shrink:0;
+ margin-top:8px
+}
+.process{
+ border-bottom:1px solid var(--line)
+}
+.process:first-child{
+ border-top:1px solid var(--line)
+}
+.process summary{
+ list-style:none;
+ display:grid;
+ grid-template-columns:130px 1fr 110px 20px;
+ gap:20px;
+ align-items:center;
+ padding:25px 0;
+ cursor:pointer
+}
+.process summary::-webkit-details-marker{
+ display:none
+}
+.process-code{
+ font-size:11px;
+ color:var(--muted);
+ letter-spacing:0
+}
+.process-title{
+ font-size:18px
+}
+.evidence-status{
+ font:10px var(--mono)
+}
+.located{
+ color:var(--accent)
+}
+.missing{
+ color:#c9b48e
+}
+.expand{
+ font-size:22px;
+ color:var(--muted)
+}
+details[open] .expand{
+ transform:rotate(45deg)
+}
+.process-content{
+ padding:0 0 30px 150px;
+ max-width:960px
+}
+.process-content>p{
+ font-size:14px
+}
+.evidence-project{
+ font-size:11px;
+ color:var(--muted);
+ margin:8px 0 0 55px;
+ display:inline-block
+}
+.pending{
+ margin-top:20px;
+ font-size:12px!important
+}
+.empty-state{
+ border:1px dashed #51594c;
+ color:var(--muted);
+ padding:22px;
+ font-size:13px
+}
+.source-note{
+ margin:50px 0 70px;
+ max-width:800px;
+ font-size:13px
+}
+.source-note .mono{
+ color:var(--accent)
+}
+.about-grid{
+ display:grid;
+ grid-template-columns:1.3fr 1fr;
+ gap:100px;
+ border-top:1px solid var(--line);
+ padding:60px 0
+}
+.about-grid p{
+ font-size:15px
+}
+.profile-facts>div{
+ border-bottom:1px solid var(--line);
+ padding:19px 0;
+ display:flex;
+ justify-content:space-between;
+ gap:25px;
+ font-size:13px
+}
+.profile-facts span{
+ color:var(--muted)
+}
+.profile-facts strong{
+ font-weight:500
+}
+.contact-section{
+ border-top:1px solid var(--line);
+ padding:60px 0 80px
+}
+.contact-section>p:last-child{
+ font-size:12px;
+ margin-top:24px
+}
+@media(min-width:1500px){
+ .hero{
+ padding-top:100px;
+ padding-bottom:100px
+ }
+}
+@media(max-width:1100px){
+ .header-inner{
+ padding:0 32px
+ }
+ .hero{
+ gap:35px
+ }
+ main{
+ padding:0 32px
+ }
+ footer{
+ margin:0 32px
+ }
+ .node{
+ min-width:75px;
+ font-size:10px
+ }
+ .wire{
+ width:22px
+ }
+ .diagram{
+ padding:35px 18px
+ }
+ .hero h1{
+ font-size:68px
+ }
+ .hero .actions{
+ gap:17px
+ }
+ .brand-name{
+ display:none
+ }
+ .exam-callout{
+ gap:40px
+ }
+ .project-layout{
+ gap:45px;
+ grid-template-columns:200px 1fr
+ }
+ .study-stamp{
+ gap:10px
+ }
+}
+@media(max-width:760px){
+ .header-inner{
+ padding:0 22px;
+ min-height:78px;
+ gap:16px
+ }
+ .header-inner nav{
+ gap:18px;
+ margin:0 auto;
+ font-size:12px
+ }
+ .monogram{
+ font-size:28px
+ }
+ main{
+ padding:0 22px
+ }
+ .hero{
+ grid-template-columns:1fr;
+ padding:48px 0;
+ gap:20px
+ }
+ .hero h1{
+ font-size:65px;
+ letter-spacing:-3.5px
+ }
+ .hero-intro{
+ max-width:530px
+ }
+ .hero-aside{
+ padding-top:10px
+ }
+ .system.large{
+ min-height:280px
+ }
+ .hero .node{
+ min-width:95px
+ }
+ .hero .wire{
+ width:35px
+ }
+ .section{
+ padding:42px 0
+ }
+ .section-heading{
+ align-items:end
+ }
+ .section-heading>.mono{
+ display:none
+ }
+ h2{
+ font-size:29px
+ }
+ .project-row{
+ grid-template-columns:28px 1fr;
+ gap:14px;
+ padding:28px 0
+ }
+ .row-link{
+ grid-column:2;
+ justify-content:flex-start;
+ gap:20px
+ }
+ .project-copy h3{
+ font-size:25px
+ }
+ .project-copy .eyebrow{
+ display:block;
+ line-height:2
+ }
+ .exam-callout{
+ padding:26px;
+ grid-template-columns:1fr;
+ gap:20px;
+ margin-bottom:50px
+ }
+ .index-preview{
+ display:none
+ }
+ footer{
+ margin:0 22px;
+ flex-wrap:wrap;
+ gap:24px
+ }
+ .footer-links{
+ gap:18px
+ }
+ footer>.mono{
+ width:100%
+ }
+ .page-heading{
+ padding:45px 0 35px
+ }
+ .page-heading h1{
+ font-size:52px;
+ letter-spacing:-2px
+ }
+ .page-heading>p:not(.eyebrow){
+ font-size:15px
+ }
+ .work-list .node{
+ min-width:90px
+ }
+ .work-list .wire{
+ width:30px
+ }
+ .project-layout{
+ grid-template-columns:1fr;
+ gap:45px;
+ padding-top:35px
+ }
+ .project-meta dl{
+ display:grid;
+ grid-template-columns:1fr 1fr;
+ gap:12px
+ }
+ .project-meta dt{
+ margin:0
+ }
+ .project-meta dd{
+ margin:0
+ }
+ .project-story h2{
+ font-size:26px
+ }
+ .evidence-toolbar{
+ align-items:stretch;
+ flex-wrap:wrap
+ }
+ .evidence-toolbar>div{
+ width:100%
+ }
+ select{
+ width:100%
+ }
+ .process summary{
+ grid-template-columns:1fr 90px 15px;
+ gap:8px;
+ padding:20px 0
+ }
+ .process-code{
+ grid-column:1/-1
+ }
+ .process-title{
+ font-size:16px
+ }
+ .process-content{
+ padding-left:0
+ }
+ .notice{
+ padding:17px
+ }
+ .about-grid{
+ grid-template-columns:1fr;
+ gap:25px;
+ padding:35px 0
+ }
+ .contact-section{
+ padding-top:40px
+ }
+ .evidence-links small{
+ min-width:42px
+ }
+}
+@media(max-width:380px){
+ .header-inner{
+ padding:0 14px;
+ gap:10px
+ }
+ .header-inner nav{
+ gap:12px
+ }
+ .languages button{
+ padding:5px
+ }
+ .hero h1{
+ font-size:57px
+ }
+ .hero .node{
+ min-width:75px
+ }
+ .hero .wire{
+ width:20px
+ }
+ .system-top,.system-bottom{
+ padding:14px;
+ font-size:8px
+ }
+ .diagram{
+ padding:35px 12px
+ }
+}
+@media(prefers-reduced-motion:reduce){
+ html{
+ scroll-behavior:auto
+ }
+ *{
+ transition:none!important
+ }
+}
+@media print{
+ :root{
+ color-scheme:light;
+ --bg:white;
+ --text:#111;
+ --muted:#444;
+ --line:#bbb;
+ --accent:#314826
+ }
+ body{
+ background:white;
+ color:#111;
+ font-size:11pt
+ }
+ header,footer,.evidence-toolbar,.skip,.expand{
+ display:none!important
+ }
+ main{
+ padding:0;
+ max-width:none
+ }
+ .page-heading{
+ padding:0 0 20px
+ }
+ .page-heading h1{
+ font-size:34pt;
+ letter-spacing:-1px
+ }
+ .notice{
+ background:none
+ }
+ .notice p{
+ color:#333
+ }
+ .process summary{
+ padding:15px 0;
+ grid-template-columns:110px 1fr 100px
+ }
+ .process-content{
+ padding-left:0
+ }
+ .process{
+ break-inside:avoid
+ }
+ .evidence-status{
+ color:#333
+ }
+ .process-title{
+ font-size:14pt
+ }
+ .source-note{
+ margin-bottom:0
+ }
+ .evidence-links a{
+ overflow-wrap:anywhere
+ }
+ .evidence-links a[href^=http]:after{
+ content:' (' attr(href) ')';
+ font-size:8pt;
+ display:block;
+ max-width:75%;
+ color:#444
+ }
+ .evidence-links>a,.evidence-entry>a:first-child{
+ display:block
+ }
+ .system{
+ background:none
+ }
+ .reflection{
+ background:none
+ }
+}
+.hero>*{
+ min-width:0
+}
+.sr-only{
+ position:absolute;
+ width:1px;
+ height:1px;
+ padding:0;
+ margin:-1px;
+ overflow:hidden;
+ clip:rect(0,0,0,0);
+ white-space:nowrap;
+ border:0
+}
+/* Phone layouts: readable diagrams and comfortable touch controls. */
+@media screen and (max-width:760px){
+ .project-copy,.project-story,.project-meta,.process-title{
+ min-width:0;
+ overflow-wrap:anywhere;
+ }
+ .languages button{
+ min-width:44px;
+ min-height:44px;
+ }
+ .button,.circle-link,.row-link{
+ min-height:44px;
+ }
+ .circle-link{
+ min-width:44px;
+ }
+ .text-link,.footer-links a{
+ display:inline-flex;
+ align-items:center;
+ min-height:44px;
+ }
+ .evidence-toolbar select{
+ min-height:48px;
+ font-size:16px;
+ }
+ .project-meta dl{
+ grid-template-columns:minmax(0,1fr) minmax(0,1.2fr);
+ }
+ .diagram .node{
+ flex:1;
+ max-width:140px;
+ overflow-wrap:anywhere;
+ }
+ .system .diagram .node{
+ font-size:11px;
+ }
+ .system-top,.system-bottom{
+ font-size:10px;
+ letter-spacing:.5px;
+ flex-wrap:wrap;
+ }
+ .study-stamp{
+ flex-wrap:wrap;
+ }
+}
+@media screen and (max-width:480px){
+ .header-inner{
+ display:grid;
+ grid-template-columns:minmax(0,1fr) auto;
+ gap:6px 12px;
+ padding:12px 20px 4px;
+ }
+ .header-inner .languages{
+ grid-column:2;
+ grid-row:1;
+ }
+ .header-inner nav{
+ grid-column:1 / -1;
+ grid-row:2;
+ width:100%;
+ justify-content:space-between;
+ gap:16px;
+ margin:0;
+ font-size:14px;
+ }
+ .header-inner nav a{
+ min-height:44px;
+ display:flex;
+ align-items:center;
+ }
+ .hero{
+ padding-top:34px;
+ }
+ .hero .actions{
+ align-items:stretch;
+ flex-direction:column;
+ gap:12px;
+ }
+ .hero .actions .text-link{
+ align-self:flex-start;
+ }
+ .process summary{
+ grid-template-columns:minmax(0,1fr) 76px 16px;
+ }
+ .reflection{
+ padding:22px;
+ }
+}
+@media(max-width:760px){
+ .hero h1{
+ font-size:clamp(42px,12.5vw,65px);
+ letter-spacing:-2.5px
+ }
+ .hero .node,.work-list .node{
+ min-width:0;
+ flex:1;
+ max-width:110px;
+ padding:17px 7px;
+ font-size:9px
+ }
+ .hero .wire,.work-list .wire{
+ width:22px;
+ flex-shrink:0
+ }
+ .hero .diagram{
+ padding:35px 16px
+ }
+ .project-heading h1{
+ font-size:clamp(35px,10vw,52px);
+ overflow-wrap:anywhere
+ }
+ .system .node{
+ min-width:0
+ }
+ .system .diagram{
+ min-width:0
+ }
+ .system .wire{
+ flex-shrink:0
+ }
+}
diff --git a/tests/content.test.mjs b/tests/content.test.mjs
new file mode 100644
index 0000000..0ad06fc
--- /dev/null
+++ b/tests/content.test.mjs
@@ -0,0 +1,28 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import { projects, processes, source, revision } from '../content.js';
+test('Evidence mappings use real process IDs and complete translations', () => {
+ assert.equal(processes.length, 8);
+ const ids = new Set(processes.map(p => p.code));
+ assert.equal(ids.size, 8);
+ assert.equal(new Set(projects.map(p => p.id)).size, projects.length);
+ for (const p of projects) {
+ for (const key of ['kind', 'title', 'name', 'intro', 'context', 'implementation', 'decisions']) {
+ assert.equal(p[key].length, 2, `${p.id}.${key}`);
+ assert.ok(p[key].every(s => typeof s === 'string' && s.length > 0));
+ }
+ for (const e of p.evidence) {
+ assert.ok(e.codes.every(c => ids.has(c)), e.path);
+ assert.ok(e.label.length === 2 && e.label.every(Boolean));
+ const url = new URL(source(e.path, e.directory));
+ assert.equal(url.hostname, 'github.com');
+ assert.ok(url.pathname.includes(revision));
+ assert.equal(decodeURIComponent(url.pathname.split(`${revision}/`)[1]), e.path);
+ }
+ }
+});
+test('Collaboration gaps remain explicit rather than claiming unsupported evidence', () => {
+ for (const code of ['B1-K2-W1', 'B1-K2-W2', 'B1-K2-W3']) {
+ assert.ok(!projects.some(p => p.evidence.some(e => e.codes.includes(code))));
+ }
+});
diff --git a/tests/editor.test.mjs b/tests/editor.test.mjs
new file mode 100644
index 0000000..b6f0a23
--- /dev/null
+++ b/tests/editor.test.mjs
@@ -0,0 +1,43 @@
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import { compileContent, validateProjects } from '../scripts/content.mjs';
+import { projects, processes } from '../content.js';
+import { profile, source } from '../content.js';
+import { readFile } from 'node:fs/promises';
+import { runInNewContext } from 'node:vm';
+
+test('content compiler preserves source data', async () => {
+ const result = await import(`data:text/javascript;base64,${Buffer.from(await compileContent()).toString('base64')}`);
+ assert.deepEqual(result.projects, projects);
+});
+test('deleting all projects or evidence is supported', () => {
+ assert.doesNotThrow(() => validateProjects([], processes));
+ assert.doesNotThrow(() => validateProjects(projects.map(p => ({ ...p, evidence: [] })), processes));
+});
+test('invalid routes, translations and mappings are rejected', () => {
+ for (const change of [{ id: '../invalid' }, { name: ['Only one language'] }, { codes: ['unknown'] }, { nodes: [] }]) {
+ assert.throws(() => validateProjects([{ ...projects[0], ...change }], processes));
+ }
+ assert.throws(() => validateProjects([projects[0], projects[0]], processes));
+});
+
+test('homepage renders after removing the featured project or all projects', async () => {
+ const code = (await readFile(new URL('../app.js', import.meta.url), 'utf8')).replace(/^import .*;\r?\n/, '');
+ for (const remaining of [projects.slice(1), []]) {
+ const elements = new Map();
+ const document = {
+ documentElement: {},
+ querySelector(selector) {
+ if (!elements.has(selector)) elements.set(selector, { innerHTML: '', addEventListener() {} });
+ return elements.get(selector);
+ },
+ querySelectorAll() { return []; },
+ };
+ runInNewContext(code, { profile, source, projects: remaining, processes, document, URLSearchParams, location: { search: '?lang=en', hash: '#home' }, window: { addEventListener() {} } });
+ const html = elements.get('main').innerHTML;
+ assert.ok(!html.includes('undefined'));
+ assert.ok(!html.includes('href="#project/warehouse"'));
+ if (remaining.length) assert.ok(html.includes(`href="#project/${remaining[0].id}"`));
+ else assert.ok(html.includes('No projects added yet.'));
+ }
+});