Get started
Set up your site
Name, logo, theme and the product repo.
Driftless keeps your settings in one file and your content in one folder. A site created with init holds only these files. The framework is in node_modules/driftless-docs, and npm update driftless-docs upgrades it.
| Path in the site folder | What it holds |
|---|---|
driftless.config.ts |
Site name, logo, versions, Ask, product repo, capture and diagram settings |
docs/nav.ts |
Tabs, groups and pages |
docs/pages/ |
One .mdx file for each page |
docs/diagrams/ |
.drawio sources and their exported .svg files |
docs/source-map.json |
The product files behind each page |
public/brand/, public/product/, public/logos/ |
Your logo, product images and clips, and integration logos |
STYLE-GUIDE.md |
How to write pages |
AGENTS.md |
Instructions for coding agents that work in the site folder |
Choose the layout
The site folder can live in your app repo, or in a repo of its own.
| Layout | Where the site goes | Choose it when |
|---|---|---|
| In-app (recommended) | A folder in the app repo, such as docs-site |
You own the app. The docs change in the same pull request as the code. |
| Separate | A docs repo of its own | You document someone else’s project, another team owns the docs, or one site covers several products. |
The drift checks and the skills find the layout from git, so the two need no different settings.
Start a new site
Create the site folder
For an in-app site, run this in your app repo:
npx github:MitchStares/driftless init docs-site cd docs-site && npm install && npm run devFor a separate site, run it beside your app repo, then start a repo:
npx github:MitchStares/driftless init my-docs cd my-docs && git init && npm install && npm run devIn-app,
initalso writes.driftless.jsonat the app repo root. It tells the skills where the docs are.Name the site
In
driftless.config.ts, setsite.name,site.docsTitle,site.websiteandsite.home. Removesite.ctato hide the header button.Add your logo
Put a light and a dark logo in
public/brand. Setsite.logoto their paths. Without a logo, the header shows the site name.Set the theme
Set
themeindriftless.config.ts. Leave it out to keep system fonts and the default accent. Refer to Fonts and colours.Connect the product repo
Set
product.repo,product.pathandproduct.ref. The drift checks and the agent skills read these. In-app,initalready setproduct.pathto the repo root.
Fonts and colours
The default theme uses each reader’s system fonts, so a reader’s browser downloads no font files. Set theme in driftless.config.ts to change this.
theme: {
fonts: 'geist',
accent: { light: '#b45309', dark: '#f5a524' },
diagramAccent: { light: '#b45309', dark: '#f5a524' },
},
| Setting | What it does |
|---|---|
fonts: 'system' |
The default. Each reader sees their platform’s own fonts. |
fonts: 'geist' |
Serves Geist and Geist Mono from your site. Readers download about 140 KB, once. |
fonts: { sans, mono, files } |
Your own font stacks. Put the font files in public/ and list them in files. |
accent |
The colour of buttons, links and selection, for light and dark. The site mixes the hover and selection shades from it. |
diagramAccent |
The highlight colour in diagrams. Leave it out to keep the drawio-design accent. |
Your own site serves every font file. No setting loads a font from another host.
The default values are in src/styles/tokens.css in the framework. Each light value has a dark value under [data-theme='dark'].
Or let an agent do it
Install the agent skills, open Claude Code in your app repo, and run /driftless-init. It asks which layout you want, creates the site folder, reads your product code, proposes a structure, and fills in the config, the nav and the source map.
More than one site in a repo
A site is a folder with driftless.config.ts, docs/ and public/. Each driftless-docs command works on the folder you run it in. To work on another folder, set DRIFTLESS_ROOT:
DRIFTLESS_ROOT=examples/open-webui npx driftless-docs build
Every command reads DRIFTLESS_ROOT, including the screenshots, diagrams and drift checks. The Open WebUI example works this way.