Multi-Instance Sites
Athen supports hosting multiple documentation sites in a single repository. Typical scenarios:
- Monorepo with several packages, each needs its own docs.
- Product documentation (Marketing, DevDocs, API) maintained together.
Configuration
Add an instances field in your root athen.config.ts:
ts
import { defineConfig } from 'athen';
export default defineConfig({
// root level config (optional)
title: 'Docs Portal',
instances: [
{
root: 'docs/core', // sub-folder path
base: '/core/' // public base path
},
{
root: 'docs/sdk',
base: '/sdk/'
}
]
});
Each instance must contain its own athen.config.ts or will inherit the root config.
Output Structure
root
└─ dist
├─ core
│ └─ index.html
└─ sdk
└─ index.html
Each sub-site has its own sitemap.xml & search-index.json.
Limitations
- Instances cannot be nested.
- Cross-instance links are not rewritten automatically; use absolute
base. - Dev server currently runs one instance at a time (choose via CLI path).
Improvements like unified multi-proxy dev server are tracked in the roadmap.
Development Workflow
During development you usually want to preview one instance at a time:
bash
# Serve docs for `docs/core`
athen dev docs/core
If you would like to spin up all instances simultaneously (for example in a monorepo), combine Athen with a task-runner such as Turbo:
bash
# package.json script inside each docs package, e.g. docs/core/package.json
{
"scripts": {
"dev": "athen dev ."
}
}
# Root command – start every docs/* workspace in parallel
pnpm turbo run dev --filter=docs/*
This starts multiple dev servers on incremental ports (8730, 8731, …) so you can preview them side-by-side.
Common Pitfalls
- Cross-instance links – Athen does not rewrite relative links between instances. Use an absolute
basepath (e.g./sdk/) when linking from Core docs into SDK docs. - Nested instances are not supported – their
rootfolders must be siblings, not children of each other. - Remember that
athen buildalways outputs todist/<base>; make sure your hosting provider allows such sub-folders.