---
title: Navigation
description: Understand file-based docs navigation, ordering, search, mobile navigation, and sidebar behavior.
order: 3
tags: [sidebar, search]
---

# Navigation

Imprensa builds navigation from your MDX files. There is no separate sidebar config to maintain.

## File-based sidebar

Every `.mdx` file under `contentDir` becomes a route and a sidebar item.

```txt
(content)/
├── getting-started.mdx        → /getting-started
└── guide/
    ├── configuration.mdx      → /guide/configuration
    └── writing.mdx            → /guide/writing
```

Nested folders become collapsible groups. The group label comes from the directory name.

## Titles and order

Use frontmatter to control the navigation label, description, and sort order.

```mdx
---
title: API Reference
description: Generated API docs for public exports.
order: 4
tags: [api, reference]
---

# API Reference
```

Lower `order` values appear first. If `title` is omitted, Imprensa falls back to the first `h1`.

## Link items

A file with `type: link` creates a sidebar item without creating a docs page. Use it for API references, GitHub repositories, community links, or external product pages.

```mdx
---
title: API Reference
type: link
link: /api
---
```

```mdx
---
title: GitHub
type: link
link: https://github.com/ilhajs/imprensa
external: true
---
```

External links open in a new tab.

## Draft and hidden pages

Use `draft: true` for unfinished pages. Drafts are removed from navigation, search, sitemap, and AI exports.

```mdx
---
title: Work in Progress
draft: true
---
```

Use `hidden: true` when a page should be routable but not listed in navigation.

## Command search

The global search is opened from the search button or with `⌘K` / `Ctrl+K`. It indexes page titles, descriptions, tags, and body text with fuzzy matching.

Good search results depend on good docs metadata:

- write a direct `title`
- add a one-sentence `description`
- add a few useful `tags`
- keep headings descriptive

## Mobile navigation

On small screens the desktop sidebar is replaced by a popover menu in the docs toolbar. It uses the same content tree, so mobile and desktop navigation stay in sync.

## Resizable sidebar

On desktop the docs sidebar is resizable. The chosen split is stored in `localStorage` and restored before paint to avoid layout flicker.
