Skip to content

Working on this site

This site is built with Astro Starlight. Every command runs inside a node:22-alpine container, so no host Node install is required. Run them from the docs/ directory.

TargetWhat it does
make install-dockernpm install inside the container
make dev-dockerDev server on localhost:4321
make build-dockerProduction build to ./dist/
make preview-dockerServe the built site
make check-dockerastro check — type and content validation
make shell-dockerShell inside the container
make cleanRemove dist/ and .astro/, keep node_modules/
make helpList every target

Override the image or port with variables:

Terminal window
make IMAGE=node:20-alpine PORT=4322 dev-docker

If you’d rather skip make, the dev target is just:

Terminal window
docker run --rm -it -v "$PWD":/work -w /work -p 4321:4321 \
node:22-alpine npm run dev -- --host 0.0.0.0 --port 4321

--host 0.0.0.0 is required — without it the server binds inside the container and the host can’t reach it. On Linux you may also need --user "$(id -u):$(id -g)" to keep file ownership sane; Docker Desktop handles that for you on macOS.

Run make check-docker before opening a PR. It catches broken frontmatter and bad content references, which is most of what goes wrong here.

Pages are Markdown under src/content/docs/<section>/. Every sidebar section is autogenerated from its directory in astro.config.mjs, so a new file shows up automatically — ordering is the only thing you control:

---
title: Package layout
description: One short clause. Keep it under ~90 characters.
sidebar:
order: 2
---

Conventions the existing pages follow:

  • A section’s index.md takes order: 1 and sidebar.label: Overview; everything else counts up from 2.
  • title is sentence case and becomes the sidebar entry unless you set sidebar.label.
  • Internal links are absolute with a trailing slash — /contributing/linting/, not a relative path or a .md filename.
  • Asides use :::note, :::caution, :::tip, optionally with a custom title: :::caution[The bug this prevents].

Adding a whole new section means adding an entry to the sidebar array in astro.config.mjs; adding a page to an existing one does not.