Something went wrong. Try again.
karitham.dev website! atproto & fancy ssg + csr & blog articles karitham.dev
atproto gleam blog nix
Something went wrong. Try again.
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253# karitham.dev — build commands.## SSG (Gleam/Erlang) + client (Gleam/JS) are separate projects.# `nix develop` drops you in a shell with everything you need.# Build the static site from scratch.build: codegen client ssg# Regenerate types/decoders from vendored Lexicon schemas. We don't# ask for the typed XRPC client — both SSG and browser go through# `shared/src/fetch.gleam`'s raw HTTP + decoders instead.codegen: gleam run -m atproto_codegen -- ./lexicons ./shared/src/gen gen app.bsky.,com.atproto.,sh.tangled.,fm.teal.# Build the JS bundle: one minified, self-executing ES module in# client/dist/, copied into dist/client/ by the SSG step.client: cd client && gleam run -m lustre/dev build --minify=true --no-html=true# Build the static site (codegen + client must exist first).ssg: gleam run# Run all tests (root + shared + client).test: gleam test cd shared && gleam test cd client && gleam test# Scaffold a new post. Usage: just new my-post-slugnew *ARGS: gleam run new {{ARGS}}# Fetch fresh listening data from PDS, then derive the stats the site embeds.# One pass: CAR in, stats out — the ~100MB raw dump is never materialized.# `--covers` enables MusicBrainz/Cover Art Archive lookups for pairs not yet# cached; with a warm cache the stats step is offline. `--images` mirrors the# resolved cover/artist images into priv/cache/img so the browser never hits# Cover Art Archive / Wikimedia at page load; a warm image cache is also offline.refresh: #!/usr/bin/env bash set -euo pipefail mkdir -p priv/cache priv/cache/img curl -sL "https://eurosky.social/xrpc/com.atproto.sync.getRepo?did=did:plc:kcgwlowulc3rac43lregdawo" \ -o priv/cache/repo.car cd tools/parse-plays && cargo run --release -- refresh ../../priv/cache/repo.car \ ../../priv/cache/plays-stats.json --covers ../../priv/cache/cover-cache.json \ --images ../../priv/cache/img# Wipe build artifacts.clean: rm -rf dist build client/build client/dist client/.lustre priv/cache