Pamphlet library
Versioned source for danielslater.dev services & pricing pamphlets β the A4 documents sent to prospects and clients. One data file drives every variant; a static build renders standalone pages plus a mobile-friendly review gallery.
β οΈ Contains client/prospect names and pricing strategy. Keep it local or in a private remote only β never a public repo.
Layout
| Path | What |
|---|---|
data.mjs |
Content for every pamphlet variant (the one file you edit). |
build.mjs |
Pure renderer β writes pamphlet.css, p/<id>.html, and index.html (the gallery). No browser needed. |
render-check.mjs |
Headless Chromium β asserts no page overflows its A4 box; optional per-page screenshots. |
thumbs.mjs |
Headless Chromium β cover thumbnails into thumbs/ for the gallery cards. |
p/ |
Generated standalone pamphlets (one HTML per variant). |
assets/ |
Real site screenshots used inside pamphlets (before/after, covers). |
thumbs/ |
Generated cover thumbnails for the gallery. |
index.html |
Generated gallery β grouped, versioned, mobile-first. |
Workflow
node build.mjs # regenerate pamphlet.css + p/*.html + index.html
node thumbs.mjs # regenerate cover thumbnails (all variants)
node thumbs.mjs low # β¦or just one
node render-check.mjs # A4 overflow check (all)
SHOTS=/tmp/out node render-check.mjs therapists # + per-page screenshots
Playwright is borrowed from ../../aerias-demo/node_modules (absolute import in
render-check.mjs / thumbs.mjs).
View it
python3 -m http.server 5300 --directory .
# desktop: http://localhost:5300/index.html
# on a phone (same Wi-Fi): http://<your-LAN-ip>:5300/index.html
Pamphlet pages carry <meta name="viewport" content="width=794"> so the fixed
A4 layout scales to fit a phone (like viewing a PDF). The gallery itself is
responsive device-width.
Adding a variant
- Add a
const X = { id, group, label, nav, version, updated, blurb, pages:[β¦] }object indata.mjs, built from theB.*block renderers (seeTHERAPISTSfor the fullest example). - Append it to the
export const pamphlets = [...]array. groupdrives the gallery section βverticalΒ·tierΒ·clientΒ·option(any new group name gets its own section automatically).node build.mjs && node thumbs.mjs X && node render-check.mjs X.
Versioning
Each variant carries version + updated, shown on its gallery card. Change
history lives in CHANGELOG.md and git.