Personal site of Engin Al: four lines, one network. Code, circuits, sound and distance are four transit lines. Projects, recordings, milestones and races are stations, and work that crosses disciplines is an interchange.
Static site built with Eleventy, edited with Sveltia CMS at /admin/, deployed to Cloudflare as a Worker with static assets (wrangler.jsonc) by Workers Builds on every push to main; the only server code is the CMS sign-in. No framework, no trackers. The network map is laid out at build time from the content (src/_lib/network.js) and ships as plain SVG; the line filter is pure CSS.
npm ci
npm run serve # http://localhost:8080 (drafts are shown, marked "draft")
npm run build # → _site/ (drafts hidden)
npm run build:deploy # clean build, content hashes in asset names, then the checks (what Cloudflare runs)
npm run check # broken links, missing alt text, CSP-unsafe markup, demo data
npm run strava:sync # pull Strava into src/_data/strava (needs .env), then commit it
npm run strava:rename # dry run of scripts/strava-renames.json; `-- --apply` renames on Strava
npm run strava:demo # fake races for layout work; `node scripts/strava-demo.mjs --clear` before committing
npm run r2:media # upload images to R2 with your wrangler login
npm run deploy # manual deploy from your machine (clean build + check + wrangler deploy)Node 22.9+.
| Path | What |
|---|---|
src/projects/<slug>/index.md |
a project; images next to it. lines: [circuits, code]: the first sets the colour, two or more make an interchange. short: is an optional map label |
src/sound/<slug>/index.md |
a live set, mix, track or release (Sound line unless lines says otherwise); embed_url (the recording) and tracklist_url (a playlist of the tracks played) become click-to-load players |
src/stops/*.md |
milestones without a page of their own: gigs without a recording, and periods with an end date (jobs, degrees), drawn as bars under the map |
src/distance/<strava-id>.md |
optional note/photo for a synced Strava activity, or show: true / hidden: true / duplicate: true |
src/notes/*.md |
occasional longer notes (not on the map, not in the menu) |
src/_data/site.json |
the four lines (name, colour, description), menu, home intro, socials |
src/_data/now.json |
the Now page and the departures board rows |
src/_data/{about,rig}.json |
Network information (about) and the instrument list on the Sound line |
src/_data/strava/ |
Strava cache written by scripts/strava-sync.mjs, committed; races become Distance stations |
src/_lib/network.js |
the map layout: one column per station by date, fixed lanes, 45° bends into interchanges, all lines ending at "Now" |
src/_lib/signal.js |
route traces, elevation profiles and weekly-distance traces as SVG paths |
src/pages/line.njk |
one page per line (/code/, /circuits/, /sound/, /distance/) |
src/pages/year.njk, search.njk |
/years/<yyyy>/ and /search/ (plus /search.json) |
src/assets/js/site.js |
click-to-load players, the split-flap animation, the menu; loads map.js (pan, timeline, station cards) and search.js on demand. Everything works without it |
public/admin/config.yml |
Sveltia CMS collections |
public/_headers, public/_redirects |
CSP and caching; old URLs → new ones |
wrangler.jsonc |
Worker name, asset handling, which paths run the Worker (/api/*) |
worker/index.js |
the only server code: GitHub sign-in for the CMS at /api/auth |
Content written as draft: true is visible in npm run serve and hidden in production.
See docs/EDITING.md. Short version: open /admin/, sign in, edit, save. The site rebuilds in about a minute.
-
Cloudflare: in the dashboard, go to Workers & Pages → Create → Import a repository, pick
casab/engin.al, and set:- Build command:
npm run build:deploy(clean build, then the same checks as CI) - Deploy command:
npx wrangler deploy - Non-production branch deploy command:
npx wrangler versions upload(every pull request gets a preview URL)
The Worker name comes from
wrangler.jsonc(engin-al). No Cloudflare secrets are needed in GitHub: the GitHub Actionsciworkflow only builds and checks. - Build command:
-
Domain: engin.al is attached to the Worker as a custom domain in the Cloudflare dashboard, deliberately not through
routesinwrangler.jsonc, so deploys never touch it. -
Strava:
- Create an API app at https://www.strava.com/settings/api with callback domain
localhost. cp .env.example .env, fill inSTRAVA_CLIENT_ID/STRAVA_CLIENT_SECRET, runnpm run strava:authand approve. This storesSTRAVA_REFRESH_TOKENin.env.npm run strava:synconce locally and look at the result on/distance/before committingsrc/_data/strava/.- Add repository secrets
STRAVA_CLIENT_ID,STRAVA_CLIENT_SECRET,STRAVA_REFRESH_TOKEN, andGH_SECRETS_TOKEN(fine-grained token for this repo only, Secrets: read and write, so the daily job can store a rotated refresh token). OptionallySTRAVA_PRIVACY_ZONES(lat,lng,radiusMetres;…). .github/workflows/strava-sync.ymlthen syncs daily and commits when something changed; that push makes Cloudflare rebuild the site.
- Create an API app at https://www.strava.com/settings/api with callback domain
-
CMS sign-in (same setup as technoetkinlik): "Sign in with GitHub" goes through the site's own Worker (
worker/index.js,/api/auth).- Create a GitHub OAuth app at https://github.com/settings/developers → OAuth Apps → New OAuth App: homepage
https://engin.al, callback URLhttps://engin.al/api/auth/callback. - In Cloudflare: Workers & Pages →
engin-al→ Settings → Variables and secrets: addGITHUB_CLIENT_IDandGITHUB_CLIENT_SECRET, both as type Secret (deploys keep secrets; plain variables would be overwritten bywrangler.jsonc). - Until then, "Sign in with Token" works with a fine-grained GitHub token (Contents: read and write on this repo).
- Create a GitHub OAuth app at https://github.com/settings/developers → OAuth Apps → New OAuth App: homepage
-
Media on R2: bucket
enginal-media(EEUR) is public athttps://media.engin.aland bound to the Worker asMEDIA. No R2 keys:npm run r2:mediauploads with your wrangler login (npx wrangler loginonce), records each file insrc/_data/media.json, and-- --prunedeletes local copies once the public copy matches. Resized images (/cdn-cgi/image/…) need image resizing on the zone (one-time, see the PR).
- The token only has
activity:read, so Strava itself leaves out "Only you" activities and privacy-zone data. - Shown on the site: races, runs of at least
STRAVA_RUN_MIN_KM(default 9.5 km) and rides of at leastSTRAVA_RIDE_MIN_KM(default 20 km). Shorter ones only feed the weekly totals, which hold no locations. - At most
STRAVA_MAX_ROUTES(default 80) new routes are downloaded per sync, to stay under Strava's 100 requests per 15 minutes; a long history fills in over the following daily syncs. - Every route loses its first and last 600 m (
STRAVA_TRIM_M) and anything insideSTRAVA_PRIVACY_ZONES, and is simplified before it's written. - The "Powered by Strava" attribution on
/distance/is required by Strava's API terms.
Fonts: Archivo and IBM Plex Mono, both under the SIL Open Font License (see src/assets/fonts/).
The code is MIT (see LICENSE). The writing, photos, recordings and Strava data on the site are Engin's own and not covered by it.