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.
Commands
Section titled “Commands”| Target | What it does |
|---|---|
make install-docker | npm install inside the container |
make dev-docker | Dev server on localhost:4321 |
make build-docker | Production build to ./dist/ |
make preview-docker | Serve the built site |
make check-docker | astro check — type and content validation |
make shell-docker | Shell inside the container |
make clean | Remove dist/ and .astro/, keep node_modules/ |
make help | List every target |
Override the image or port with variables:
make IMAGE=node:20-alpine PORT=4322 dev-dockerIf you’d rather skip make, the dev target is just:
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.
Adding a page
Section titled “Adding a page”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 layoutdescription: One short clause. Keep it under ~90 characters.sidebar: order: 2---Conventions the existing pages follow:
- A section’s
index.mdtakesorder: 1andsidebar.label: Overview; everything else counts up from 2. titleis sentence case and becomes the sidebar entry unless you setsidebar.label.- Internal links are absolute with a trailing slash —
/contributing/linting/, not a relative path or a.mdfilename. - 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.