Design the navigation of your documentation site with apigit.json
A documentation site is found useful or not in its first ten seconds, and what a reader sees in those seconds is the menu. Published without any configuration, an APIGit document lists every API file and Markdown file of the repository as a tree, in the order of the folders. That is a fair default and a poor table of contents. One file in the repository, apigit.json, turns it into the navigation you would design: your groups, your order, your names, and only the pages you want readers to see.
This post was first published in 2025. It is rewritten for the form editor, the seven themes and the local preview that have been added since.
What the file decides
apigit.json lives in the repository root, so the navigation is versioned with the content: every published version carries the menu of its own commit. The file decides:
- which files appear, and which stay out of the menu
- how they are grouped and ordered, at any depth
- the name, icon and address (slug) of every entry
- links to places outside the repository
- optionally, the theme of the versions published from this file
Logo, colours, header and footer are not in this file. They are set once per repository in the Site Settings.

Build it in the form
You do not have to write JSON. Create the file with the + above the file list and choose Navigation, or open an existing apigit.json: APIGit shows it as the navigation it describes, and in edit mode as a form.

- Add a group, a page or a link, then drag a row to where it belongs. The buttons on a row move it up, down, into the group above it or out of its group, so everything also works from the keyboard.
- The selected entry shows its name, its slug, the file it points to, picked from the repository's Markdown and API files, and an icon picked from a searchable list.
- Unlisted files are the files no entry points to. One click adds one as a page. It is also the quickest check that nothing was forgotten.
- Generate Navigation fills the menu with one entry per file, following your folders, which is a good start for a repository that already has many pages.
- Problems are shown on the entry they belong to, for example a page whose file no longer exists.
The Code tab shows the same file as JSON, with an outline of the navigation beside it, and Diff shows what you changed. Form and code edit one file, and anything the form has no field for is kept as written.
The file itself
{
"theme": "clover",
"nav": [
{
"name": "Guides",
"icon": "book-open",
"children": [
{ "name": "Quick start", "file": "docs/quick-start.md", "icon": "rocket" },
{ "name": "Authentication", "file": "docs/authentication.md", "icon": "key" }
]
},
{
"name": "API Reference",
"icon": "code",
"children": [
{ "name": "Orders API", "file": "openapi/orders.yaml" },
{ "name": "Order events", "file": "asyncapi/order-events.yaml" }
]
},
{ "name": "Status", "url": "https://status.acme.example", "icon": "activity" }
]
}
Every entry has a name and exactly one of four things:
| Field | The entry is | Notes |
|---|---|---|
file | A page: a Markdown file or an API description | The path in the repository, without a leading / |
url | A link to another site | |
children | A section with entries below it | Nesting has no limit |
group | A top-level menu | Top level only. In themes with a top bar, groups become its tabs |
slug and icon are optional. Icons are Lucide or Font Awesome names.
Three things worth knowing
A slug is a published address. The slug is the entry's part of the page URL. In the form, the slug of a new entry follows its name until you type one. The slug of an entry that is already in the file never changes when you rename the entry, so links to published pages keep working. Change it deliberately, and when you do, add the old address under Redirects in the Site Settings.
Navigation is not access control. It decides what the menu shows. Who may read a published version is decided by the version's access setting.
The theme in the file is for one version. The site's theme is chosen in the Site Settings and applies to every version. A theme in apigit.json overrides it for the versions published from that file, which is how you try a new look on a preview version first. The seven themes are described in Themes. In Clover, Birch and Alder the top-level groups sit in a top bar; in the others everything is in the sidebar.
Check it before you publish
In edit mode, the globe button opens the real published page for the branch. And in a clone of the repository, the command line shows the site on your machine exactly as it will be published, navigation, icons, hidden files and theme included:
apigit preview
The page reloads when you save apigit.json, so arranging a large menu becomes a matter of seconds per change.
A structure that works
Most API documentation settles on the same three parts, and it is a good place to start:
- Guides: a quick start, authentication, and the two or three tasks most readers come for.
- API reference: one entry per API description. In the published site, the operations of an OpenAPI document are listed under its entry.
- Resources: changelog, status page, support, as links.
Keep names short, put the page a new reader needs first, and leave internal notes out of the menu. The full reference is Custom navigation.