Skip to content
Preset · built on app

Docs kit

Start a docs site from markdown files: a sidebar, search, dark mode and copies for coding agents, prerendered to static HTML.

For: Projects that need a docs site written in markdown, fast to load and easy for coding agents to read.

kitr new my-app --kit docs

First time? Run npm i -g @kitr/kitr once. Inside a project, the global kitr runs your project's own version.

kitr dev
The docs site, reloading as you edit markdown
kitr build
Every page as static HTML
npm test
Vitest, rendering a page with its sidebar

Write markdown, get pages

Each file in content/docs/ is a page, ordered by nav.json.

Search and dark mode

Cmd+K searches every page, and the theme follows the system or the toggle.

Static and fast

Every page is prerendered to HTML, with no server to run.

Agents can read it

The build writes llms.txt, llms-full.txt and a .md copy of every page.

What's inside

Read from the kit's output in the kitr repository, so it matches what kitr new writes today. 7 packages · 6 components · 35 files.

Platforms
site: webstatic
Packages
routercontentseotailwindthemetestingvite
Components
buttoncommanddoc-layouticonsearch-dialogtheme-toggle

Every file it writes

Start with content/docs/getting-started.md. Pick any file to read it.

Source
content/docs/getting-started.md
---
title: Getting started
description: Run the docs site, add a page and publish it.
---

# Getting started

This site is markdown in `content/docs/`, rendered by `kitr generate` and served by a static web platform. Every page is plain HTML after `kitr build`, so any static host can serve it.

> [!SUMMARY]
> Write a page in `content/docs/<slug>.md`, list its slug in `content/docs/nav.json`, and it appears at `/docs/<slug>` with the sidebar, search and an `llms.txt` entry.

## 1. Run the site

Start the dev server. It renders the markdown on start and again whenever you save a page.

```sh
kitr dev
```

Open the address it prints. The page you are reading is `content/docs/getting-started.md`.

## 2. Add a page

Create a markdown file. The file name is the page's slug and the last part of its URL.

```md
<!-- content/docs/deploy.md -->
---
title: Deploy
description: Publish the site to any static host.
---

The build writes plain HTML to `dist/site/client`.
```

Then list the slug in the group it belongs to. The order in `nav.json` is the order of the sidebar and of the previous and next links.

```json
// content/docs/nav.json
[
  {
    "title": "Start here",
    "pages": ["getting-started", "writing", "deploy"]
  }
]
```

## 3. Publish it

Build the site, then upload `dist/site/client` to any static host.

```sh
kitr build
```

The build prerenders every page linked from the home page and writes `llms.txt`, `llms-full.txt` and a `.md` copy of each page beside the HTML, so coding agents can read the docs without a browser.

> [!TIP]
> `kitr start` serves the built folder locally, so you can check the result before you upload it.

## Next steps

- [Write pages](./writing.md): frontmatter, callouts, code captions and commands.
- [Content package](https://kitr.dev/packages/content): every option of `config/content.ts`.

Other kits

All kits →