chore(site): live-reload dev server #132

Merged
razvandimescu merged 1 commits from chore/site-live-reload into main 2026-04-22 22:17:38 +08:00
razvandimescu commented 2026-04-22 21:36:09 +08:00 (Migrated from github.com)

Summary

  • scripts/serve-site.sh now uses chokidar-cli + browser-sync instead of plain python3 -m http.server: MD edits regenerate HTML, browser reloads on rendered-asset changes.
  • First run pulls both via npx (slow once, instant after).
  • Preflight checks for npx and pandoc.
  • Cleanup trap kills watcher + server on exit so re-runs don't leave orphans.
  • Port arg parsing tolerates legacy --drafts flag ordering; drafts are always included now (that's what the dev loop actually wants).

CI is intentionally skipped for scripts/serve-site.sh via paths-ignore in .github/workflows/ci.yml — no Rust surface to test.

Test plan

  • bash -n scripts/serve-site.sh clean (syntax valid).
  • scripts/serve-site.sh 9000 serves at http://localhost:9000.
  • Editing a drafts/*.md file regenerates HTML; browser tab reloads automatically.
  • Ctrl-C leaves no orphaned chokidar / browser-sync processes (pgrep -f chokidar empty).
  • Missing pandoc or npx produces a clear install-pointer error.
## Summary - `scripts/serve-site.sh` now uses `chokidar-cli` + `browser-sync` instead of plain `python3 -m http.server`: MD edits regenerate HTML, browser reloads on rendered-asset changes. - First run pulls both via `npx` (slow once, instant after). - Preflight checks for `npx` and `pandoc`. - Cleanup trap kills watcher + server on exit so re-runs don't leave orphans. - Port arg parsing tolerates legacy `--drafts` flag ordering; drafts are always included now (that's what the dev loop actually wants). CI is intentionally skipped for `scripts/serve-site.sh` via `paths-ignore` in `.github/workflows/ci.yml` — no Rust surface to test. ## Test plan - [x] `bash -n scripts/serve-site.sh` clean (syntax valid). - [ ] `scripts/serve-site.sh 9000` serves at `http://localhost:9000`. - [ ] Editing a `drafts/*.md` file regenerates HTML; browser tab reloads automatically. - [ ] Ctrl-C leaves no orphaned `chokidar` / `browser-sync` processes (`pgrep -f chokidar` empty). - [ ] Missing `pandoc` or `npx` produces a clear install-pointer error.
Sign in to join this conversation.