One repository, one kit, many sites

How the portfolio is organized: a single workspace, a shared site kit, a per-site folder with only what differs, and static output that can be hosted anywhere.

Updated

Every site in the portfolio lives in one repository and is built on one shared package, the site kit. A site's own folder holds only what makes it different: its settings, its typefaces, a small stylesheet and its pages. Fixing something in the kit fixes it for every site at once.

The layout

Folder What it holds
docs/ The list of domains with their site ideas, and the authoring guide
packages/site-kit/ The shared kit: layout, page templates, styles, SEO
boilerplates/ The starting shape for a new site
scripts/ Commands that scaffold a site, build the redirect list and eject a site
sites/<domain>/ One folder per site

It is a pnpm workspace, so each site is its own package and can be built alone with pnpm --filter <domain> build.

What is in a site folder

  • site.config.ts: the name, headline, description, color theme, layout choices, sections and any disclaimer.
  • app/layout.tsx: the two typefaces.
  • app/site.css: one or two visual details that belong to that site only.
  • content/<section>/*.md: one Markdown file per page.
  • NOTES.md: what is not built yet.

The remaining files in a site's app/ folder are a few lines each. They hand the site's configuration to the kit, and the kit produces the home page, section pages, article pages, sitemap and robots file.

Starting a site

A new site is scaffolded with one command, pnpm create-site <domain>. The script copies the boilerplate, reads the domain's row in the list and writes a starter configuration with the site idea in a comment at the top.

Domains that exist only to catch a typo or a second spelling do not get a site. A script reads those rows and writes a list of redirects instead.

Static first

The sites are built with Next.js and exported as plain files: HTML, CSS and a little JavaScript. There is no server to run and no database to maintain, so the output can be put on any static host. Pages are fast because there is nothing to compute when a visitor arrives.

A handful of ideas need more than static pages. Those have a second boilerplate with an API alongside the web pages, and everything else stays static.

Data without Markdown

A section does not have to come from Markdown files. It can be given a function that runs at build time and returns the entries. That is the planned route for the data-driven sites, where one dataset should produce thousands of pages in the same shape.

A way out

Sharing a kit has a cost: a site that outgrows the shared structure is stuck with it. So there is an eject command, which copies one site out into a standalone project with its own private copy of the kit. A site that becomes something bigger can leave without a rewrite.

Next: the accuracy rules.