# www The site at [tidy.lukeed.com](https://tidy.lukeed.com), built with [bongo](https://bongo.build) and served from Cloudflare Workers static assets. ```sh bun install bun run dev # http://localhost:3000 bun run build # writes public/ bun run preview # wrangler dev, with the Worker bun run deploy # build, then wrangler deploy bun run check # the home page samples are still what tidy prints ``` ## Layout | Path | What it is | | ----------- | -------------------------------------------------------------------------------------------- | | `content/` | Pages. `index.hbs` is the home page; `docs/*.md` are the docs. | | `layouts/` | `html.hbs` wraps everything; `docs/index.hbs` is the docs shell. | | `partials/` | The header, the wordmark, the search dialog. | | `assets/` | Styles, the client script, fonts and images. | | `data/` | `bench.ts` holds the benchmark numbers, `release.ts` reads the version from `Cargo.toml`. | | `samples/` | The before and after on the home page, plus `check.ts`, which proves they are tidy's output. | | `worker.ts` | The analytics proxy and the install script. | Sidebar groups come from each page's `group` frontmatter, ordered by `order`. The group names and their order live in `GROUPS` in `utils.ts`. ## The Worker Everything is a static asset except four paths, listed in `run_worker_first`: - `/x/script.js` and `/x` proxy [crowne.io](https://crowne.io), so that a blocker is less likely to drop them. - `/install.sh` serves the install script. - `/` serves the install script to a command line (`curl`, `wget`, …) and the home page to a browser, so `curl -fsSL https://tidy.lukeed.com | sh` works. Serving the script counts a `download` event, with `piped` (whether it came from `/` or `/install.sh`) and `platform`. The archives themselves come from GitHub releases, so that event is the closest thing to a download count. Analytics never block the response: a failed event is logged and dropped. ## Before deploying 1. Put the crowne.io site id in `CROWNE_SITE` in `wrangler.jsonc`. 2. Set the key as a secret: `bunx wrangler secret put CROWNE_KEY`. 3. Point `tidy.lukeed.com` at the Worker, which the `routes` entry claims as a custom domain. Without both values the Worker still serves everything; it just counts nothing. ## Benchmark numbers `data/bench.ts` is the single source for the home page and the Benchmarks page. It is transcribed from `bench/results/format`; update it when the benchmarks are re-run.