Migrate Vite SPA to Hugo (hugo-coder, dark) with WebGPU background

- Hugo static site at root: config, content (home/about/resume/blog + 5 projects),
  data/resume.yaml, custom layouts (gpu background, resume renderer, projects list),
  dark theme with canvas behind content
- gpu-bg/: extracted WebGPU/WebGL2 spiral engine as a Vite sub-package; slim bootstrap
  drops router/overlay/text renderer; fixed uniforms (scene0/dim0); self-contained engine.js
- archive/: retired Vite SPA preserved (router, overlay, data, engine/text orphaned)
- 3-stage Dockerfile (node -> hugo extended/dart-sass -> nginx), static nginx config
- DEPLOYMENT.md handover + README rewrite; pre-hugo rollback tag
This commit is contained in:
2026-08-21 03:39:42 +02:00
parent 3ad5cf55e3
commit 9ea85db5ce
74 changed files with 3170 additions and 75 deletions

View File

@@ -1,46 +1,46 @@
# WebGPU Portfolio
# Djosen — personal site
Hugo static site (hugo-coder theme, dark) with a WebGPU spiral background on the homepage.
[![Build & Deploy](https://git.djosen.one/djoser/webgpu-portfolio/actions/workflows/deploy.yml/badge.svg?branch=master)](https://git.djosen.one/djoser/webgpu-portfolio/actions)
Generative-art portfolio site. WebGPU canvas background, DOM overlay UI.
## Structure
- **Hugo site (repo root):** `content/` (pages, projects, posts), `data/resume.yaml`, `layouts/` (custom homepage/resume templates), `themes/hugo-coder` (git submodule), `static/gpu/` (the compiled engine bundle).
- **`gpu-bg/`** — the WebGPU/WebGL2 background engine (`Vite` + `Typescript`), built to a static JS bundle.
- **`archive/`** — the retired Vite SPA, preserved for reference.
## Dev
**Hugo server** (site content):
```bash
npm install
npm run dev # vite dev server (opens browser)
npm run typecheck # tsc --noEmit
npm run build # typecheck + vite build → dist/
npm run preview # serve built dist/
hugo server
```
**Engine** (background):
```bash
cd gpu-bg && npm run dev
```
**Full loop** — build the engine, copy the bundle into the Hugo site, then serve:
```bash
cd gpu-bg && npm install && npm run build
cp gpu-bg/dist/engine.js static/gpu/engine.js
hugo server
```
## Docker
```bash
# Build
docker build -t webgpu-portfolio .
# Run (foreground)
docker run --rm -p 8080:80 webgpu-portfolio
# Run (detached)
docker run -d -p 8080:80 --name portfolio webgpu-portfolio
# Compose
docker compose build
docker compose up -d
```
Site at `http://localhost:8080`.
Site at `http://127.0.0.1:8080`.
### Smoke test
## Deploy
```bash
docker run -d -p 8080:80 --name portfolio-test webgpu-portfolio
curl -sSf http://localhost:8080/ > /dev/null && echo "OK"
curl -sSf http://localhost:8080/assets/ | head -1 # should 200 (hashed JS)
docker stop portfolio-test
```
### Image size
~6 MB (nginx:alpine-slim + static dist). Multi-stage build — Node build layer is discarded.
Server-side deployment (Gitea Actions / webhook) is documented in [DEPLOYMENT.md](DEPLOYMENT.md) — including the mandatory recursive-submodule checkout for the Hugo build.