Skip to Content
API DocumentNavigation

Overview

When publishing API documentation from a Git repository, APIGIT shows all API specifications and Markdown files at the published commit (SHA). By default, files are displayed in the sidebar menu in their natural order, which may not provide the optimal user experience for your documentation.

To customize your documentation site’s navigation and menu structure, create an apigit.json file in your repository root. This navigation configuration file enables you to:

  • Control which files are displayed or hidden
  • Organize content into logical hierarchies
  • Create custom navigation menus
  • Add external links beyond repository files
  • Enhance menu items with icons

The navigation configuration transforms your documentation from a simple file listing into a structured, user-friendly experience that helps readers find information quickly and efficiently.

Below is an example of how navigation and sidebar organization appears with a configured apigit.json file:

Published document with Guides and API Reference groups in the sidebar

The Form Editor

You do not have to write the file by hand. Open apigit.json in your repository and APIGIT shows it as the navigation it describes: the theme it names, the groups, pages and links with their icons, and a warning on every entry that has a problem, such as a page whose file no longer exists. To see the JSON or what changed, use the view switch on the file’s row in the file list, as for any other file. Click Edit and the file opens in a form:

The form editor of apigit.json: the theme line, the navigation tree, the selected entry and the unlisted files

  • Theme: the line at the top names the theme of the versions published from this file. When the file names none, the line says which theme the site settings give it, for example “not set (the site’s theme, Fern, is used)”. Change opens the themes: pick one, or Use the site’s theme to leave the choice to the site settings.
  • Navigation: add a group, a page or a link, then drag a row to where it belongs, or use the buttons on the row to move it up or down, into the group above it, or out of its group. Deleting an entry can be undone.
  • The selected entry: its name, its slug, the file it shows, picked from the repository’s Markdown and API files, a link’s address, and an icon picked from a searchable list.
  • Slugs and renaming: the slug is the entry’s part of the page address. For an entry you add in the form it follows the name until you type one yourself. The slug of an entry that is already in the file never changes when you rename the entry, so the addresses of published pages stay as they are; change it in the Slug field when you mean to.
  • Unlisted files: the Markdown and API files no entry points to. One click adds a file as a page, in the selected group or at the top level.

Problems are shown on the row and under the field they belong to. Code switches to the JSON described below, with an outline of the navigation next to it that follows what you type and can be hidden, and Diff shows what you changed; the form and the code edit the same file, and anything in it that the form has no field for is kept as it is. A file you open and leave alone is not changed, and a change you make in the form changes only the lines it touches: the rest of the file keeps its indentation, its layout and its key order, so the diff shows your edit and nothing else. An icon name that the icon sets do not have is reported on its entry. Commit your changes as you do for any other file.

Configuration Example

Here’s a comprehensive example of an apigit.json configuration file. Besides nav, the file can name the theme of the versions published from it; nothing else is read from it. Logo, footer, colours and the other site settings are set in the Publish Center, under Site Settings.

apigit.json
{ "theme": "sequoia", "nav": [ { "name": "Getting Started", "slug": "getting-started", "icon": "sparkle", "children": [ { "name": "Introduction", "slug": "introduction", "file": "introduction.md", "icon": "book-open" } ] }, { "name": "Basic Elements", "slug": "basic", "icon": "swatch-book", "children": [ { "name": "Headers and Text", "slug": "header-and-text", "file": "basic/header-and-text.md", "icon": "type" }, { "name": "Lists and Tables", "slug": "list-and-tables", "file": "basic/list-and-tables.md", "icon": "table" }, { "name": "Icons", "slug": "icon", "file": "basic/icon.md", "icon": "smile" }, { "name": "Admonitions", "slug": "admonition", "file": "basic/admonition.md", "icon": "alert-triangle" }, { "name": "Code Blocks", "slug": "code", "file": "basic/code.md", "icon": "code" }, { "name": "Images", "slug": "image", "file": "basic/image.md", "icon": "image" } ] }, { "name": "Interactive Components", "slug": "components", "icon": "component", "children": [ { "name": "Accordions", "slug": "accordions", "file": "components/accordions.md", "icon": "chevron-down" }, { "name": "Expandable Content", "slug": "expandable", "file": "components/expandable.md", "icon": "expand" }, { "name": "Cards", "slug": "card", "file": "components/card.md", "icon": "square" }, { "name": "Card Groups", "slug": "cardgroup", "file": "components/cardgroup.md", "icon": "layout-grid" }, { "name": "Code Groups", "slug": "code-group", "file": "components/code-group.md", "icon": "file-code" }, { "name": "Columns", "slug": "columns", "file": "components/columns.md", "icon": "layout-template" }, { "name": "Steps", "slug": "steps", "file": "components/steps.md", "icon": "list-ordered" }, { "name": "Tabs", "slug": "tabs", "file": "components/tabs.md", "icon": "folder-open" }, { "name": "Mathematical Formulas", "slug": "formula", "file": "components/formula.md", "icon": "calculator" }, { "name": "Frames and Backgrounds", "slug": "frame-and-background", "file": "components/frame-and-background.md", "icon": "picture-in-picture" }, { "name": "Video", "slug": "video", "file": "components/video.md", "icon": "video" }, { "name": "Embedding", "slug": "embedding", "file": "components/embedding.md", "icon": "external-link" }, { "name": "JSON Schema", "slug": "json-schema", "file": "components/json-schema.md", "icon": "braces" }, { "name": "Fields", "slug": "field", "file": "components/Field.md", "icon": "rectangle-ellipsis" }, { "name": "Tooltips", "slug": "tooltips", "file": "components/tooltips.md", "icon": "help-circle" }, { "name": "Copy to Clipboard", "slug": "copy-to-clipboard", "file": "components/copy-to-clipboard.md", "icon": "copy" }, { "name": "Change Tracking", "slug": "change", "file": "components/change.md", "icon": "git-commit-horizontal" } ] }, { "name": "Mermaid Diagrams", "slug": "mermaid", "icon": "swatch-book", "children": [ { "name": "Architecture Diagrams", "slug": "architecture", "file": "mermaid/architecture.md", "icon": "building" }, { "name": "Class Diagrams", "slug": "class", "file": "mermaid/class.md", "icon": "box" }, { "name": "Entity Relationship Diagrams", "slug": "entity-relationship", "file": "mermaid/entity-relationship.md", "icon": "network" }, { "name": "Gantt Charts", "slug": "gantt-chart", "file": "mermaid/gantt-chart.md", "icon": "calendar" }, { "name": "Git Graphs", "slug": "git-graph", "file": "mermaid/git-graph.md", "icon": "git-branch" }, { "name": "Packet Diagrams", "slug": "packet", "file": "mermaid/packet.md", "icon": "package" }, { "name": "Pie Charts", "slug": "pie", "file": "mermaid/pie.md", "icon": "pie-chart" }, { "name": "Quadrant Charts", "slug": "quadrant", "file": "mermaid/quadrant.md", "icon": "layout-grid" }, { "name": "Radar Charts", "slug": "radar", "file": "mermaid/radar.md", "icon": "scan" }, { "name": "Requirement Diagrams", "slug": "requirement", "file": "mermaid/requirement.md", "icon": "check-square" }, { "name": "Sequence Diagrams", "slug": "sequence", "file": "mermaid/sequence.md", "icon": "arrow-right" }, { "name": "State Diagrams", "slug": "state", "file": "mermaid/state.md", "icon": "circle-dot" }, { "name": "Timelines", "slug": "timeline", "file": "mermaid/timeline.md", "icon": "clock" }, { "name": "Treemaps", "slug": "treemap", "file": "mermaid/treemap.md", "icon": "tree-pine" }, { "name": "User Journey Maps", "slug": "user-journey", "file": "mermaid/user-journey.md", "icon": "map" }, { "name": "XY Charts", "slug": "xy", "file": "mermaid/xy.md", "icon": "line-chart" } ] } ] }

Entry Structure

All navigation entries are defined within the nav array in your apigit.json file. Each entry supports the following fields:

Required Fields:

  • name: The display name for the navigation or sidebar entry

Exactly one of these fields is also required:

  • file: File path to the document or API specification in your repository, without a leading /. The file must exist in the repository
  • url: External URL for the navigation entry (e.g., “https://apigit.com ”)
  • children: Array of nested entries for creating submenus and hierarchical navigation
  • group: Array of entries for two-level top navigation menus (top-level only)

Optional Fields:

  • slug: A URL-friendly identifier for the entry. If omitted, automatically generated from the name
  • icon: Icon displayed before the name. Supports Lucide icons and Font Awesome icons

Entry Types

The navigation system supports four primary entry types:

  1. File Entry: { name, icon, slug, file } - Links to a document in your repository
  2. External Link: { name, icon, slug, url } - Links to an external URL
  3. Parent Entry: { name, icon, slug, children } - Contains nested navigation items
  4. Group Entry: { name, icon, slug, group } - Creates grouped top-level navigation (top-level only)

Creating a Navigation File

To create a new navigation configuration:

  1. Click the ”+” icon in your project
  2. Select the Navigation file-type card
  3. Click the “Create” button

This creates an apigit.json with an empty navigation and opens it in the form editor, with the repository’s files under Unlisted files, ready to be added one by one. To start from the whole repository instead, click Generate Navigation in the editor’s toolbar: it fills the navigation with one entry per file, following your folders. When files are added or removed later, you need to update the navigation structure yourself.

Editing Navigation Configuration

To modify an existing navigation file:

  1. Select the apigit.json file from your repository file list and enter edit mode
  2. Change the navigation in the form, or switch to Code to edit the JSON
  3. Open Preview in the form, or look at the preview next to the code, to see the navigation menu as you make changes

The Generate Navigation button in the toolbar replaces the navigation with one built from your current repository files (the theme and anything else in the file stay), providing a convenient starting point for further customization.

Checking Navigation Before You Publish

In a clone of the repository, apigit preview applies apigit.json on your machine as the published page does: the groups, the icons, the hidden files and the theme. The page reloads when you save the file, so you can adjust the navigation and see the result before committing.

Default Navigation Behavior

When no apigit.json file exists in your repository root, APIGIT automatically generates navigation by listing all API specification files and Markdown documents as a sidebar tree. While functional, this default approach may not provide the optimal organization for your documentation.

For the best user experience, we recommend creating a custom navigation configuration that organizes your content logically and helps users find information efficiently.

Last updated on