Navigation Configuration

You usually do not configure navigation. Every Markdown file under content/ is published and placed in the sidebar automatically, grouped by folder. This site's sidebar is built that way β€” payload/config.ts contains no navigation array at all.

Configure it only when you want something the filesystem cannot express.

The default: from the filesystem

text
content/
β”œβ”€β”€ intro.md                    β†’ a top-level page
└── getting-started/            β†’ a section
    β”œβ”€β”€ quick-start.md          β†’ a page inside it
    └── installation.md

Names come from each page's frontmatter title, falling back to a tidied-up file name (quick-start.md β†’ "Quick Start").

Files and folders whose names start with _ or . are skipped, so drafts can live in content/_drafts/ without being published.

Ordering

Pages β€” frontmatter order

markdown
---
title: Quick Start
order: 1
---

Lower numbers come first. Pages without an order sort after those that have one, alphabetically by title.

Sections β€” _meta.json

Drop a _meta.json beside a folder's pages:

json
{
  "name": "πŸ“š Getting Started",
  "order": 2,
  "color": "#dbeafe"
}
FieldPurpose
nameSection label; defaults to the tidied folder name
orderPosition among siblings
colorBackground tint, as #rrggbb
iconIcon identifier
hiddenKeep the whole section out of the sidebar

Mixing pages and sections

Top-level pages and sections share one sequence. A root page's own order ranks it against the sections' _meta.json orders:

text
content/intro.md         order: 1   β†’ first
content/getting-started/ order: 2   β†’ second
content/configuration/   order: 3   β†’ third

Hiding a page

markdown
---
title: Draft
hidden: true
---

The page still builds and is still reachable by URL β€” it just does not appear in the sidebar, Search, the graph, or the sitemap. See Hidden Pages.

Taking manual control

Add a navigation array to payload/config.ts when you want an order or a grouping the folder structure cannot produce:

typescript
navigation: [
  { name: '🏠 Introduction', path: 'intro' },
  {
    name: 'πŸ“š Getting Started',
    color: '#dbeafe',
    children: [
      { name: 'Quick Start', path: 'getting-started/quick-start' },
      { name: 'Installation', path: 'getting-started/installation' },
    ],
  },
];
FieldPurpose
nameLabel in the sidebar
pathContent path without .md; omit to make a section header
childrenNested items, to any depth
colorBackground tint for the item and its children
iconIcon identifier
hiddenHide this item, and everything under it

Manual and automatic together

A navigation array does not have to be exhaustive. Entries you write control naming and order; any page it does not mention is still discovered and appended to the section covering its folder.

That means adding a page never requires editing config β€” it only lets you override where it lands.

A section is taken to cover a folder when all its entries live in that folder. Sections spanning several folders are left alone, since appending to them would be a guess; discovered pages from an unclaimed folder get a new section instead.

To make the array exhaustive and stop discovery entirely:

typescript
global: {
  autoNavigation: false,
}

Nesting

Nest as deep as you need β€” the filesystem and the array both support it. Past three or four levels a sidebar gets hard to scan; consider whether Search and wiki links would serve readers better than another tier of folders.

Checking the result

bash
npm run show-urls

Lists every page that will be built, in order, with its URL.

Next