---
title: "Docs and website"
description: "How this documentation and slotline.tech are built, and the conventions for adding a page."
---

Both sites are built with [Simple Engine](https://simpleengine.com) and live in the same repository.

| Folder | Site | Run it |
| --- | --- | --- |
| `site/` | [slotline.tech](https://slotline.tech) | `yarn dev` |
| `docs/` | docs.slotline.tech | `yarn dev:docs` |

You need Node 20 or later and Yarn 4. Run `yarn` once at the root of the repository to install.

## Add a docs page

1. Create a Markdown file under `docs/content/`. The path is the address: `docs/content/amp-card/parts.md` becomes `/amp-card/parts`.
2. Give it front matter:

   ```yaml
   ---
   title: What’s on the card
   description: One sentence that says what the page covers.
   layout: doc
   ---
   ```

3. Add it to `docsNav` in `docs/simple.config.js`. A page that isn't listed there doesn't appear in the sidebar.
4. Run the check:

   ```bash
   yarn check:docs
   ```

   It fails if a page is missing from the sidebar, or if a link points at a page that doesn't exist.

## Writing conventions

- **Say what is real.** Nothing has been built yet. Label design targets as targets, and unverified details as unverified.
- **Link with root-relative paths**, like `/amp-card/files`, so the link checker can follow them.
- **Take facts from the files.** Pinouts and part numbers come from `hardware/`. If a page and a file disagree, the file is right and the page needs fixing.
- **Start the body at `##`.** The page title is the only `#` heading.

## Callouts

Use GitHub's alert syntax:

```markdown
> [!WARNING]
> Never fit JL1 or JL2 on a stereo card.
```

The types are `NOTE`, `TIP`, `IMPORTANT`, `WARNING` and `CAUTION`.

## Search

Search is built with Pagefind when the site is built, so it doesn't work in `yarn dev:docs`. To try it:

```bash
yarn build:docs
yarn workspace slotline-docs preview
```

## Deploying

Both sites deploy to Cloudflare as Workers with static assets: `yarn deploy` for the website and `yarn deploy:docs` for the docs.
