Skip to content

Static site generation

Routes, data, and JSX in. Plain HTML out.

Every component on this page ran once, during the build. The browser receives one HTML file with its styles inside it — no runtime to download, nothing to hydrate, nothing to wait for.

A welder in a protective mask sending up a shower of sparks from a joint.

By the numbers

What a page actually costs

The claims this site makes about itself, stated as figures rather than adjectives.

JavaScript shipped to the browser
0 kB
Request to first paint, stylesheet included
1
Build-time SEO and accessibility checks
16
Contrast, in both colour schemes
AAA

How it works

Four moving parts, and no fifth one

Routes decide what pages exist, data supplies what they say, components decide how they look, and the build turns all of it into files.

  1. 1. Routes

    A file in src/pages becomes a URL. index.tsx drops from the path, and a [param] segment exports the values to build one page for each.

  2. 2. Data

    Ordinary TypeScript objects and arrays, kept next to the route that reads them. No Markdown parser, no front matter, no content API to call.

  3. 3. Components

    Typed functions returning JSX, which own every design decision the site makes. Preact renders them to strings and never reaches the browser.

  4. 4. Output

    Plain HTML with its stylesheet inside it, plus a sitemap, a feed, a manifest and robots.txt, all written before public/ is copied over the top.

A quiet, well-lit office lounge with pale armchairs and a tall black floor lamp.

Services

Work that ends in files on a server

Four engagements, each one finishing with plain HTML and nothing running in the browser.

Products

Three objects in an array

Every page under /products was generated by walking the same list of plain TypeScript objects.

Blog

Written while building this

Posts on the decisions behind the site, newest first. All of them are in the feed.

Content

Long-form copy is just JSX

There is no Markdown parser and no CMS behind this paragraph.

Text like this is written directly as components and type-checked with everything else, so a renamed field is a build error rather than a blank space on a page.

The 4 services, 3 products and 5 posts on this site are three arrays. Every page you can reach from here was generated by walking one of them.

Have a site that ships too much?

Tell us the URL, what you want to be different about it, and roughly when.