Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/content/docs/4.utils/2.query-collection-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,24 @@ Make sure to create `server/tsconfig.json` file with the following content to av

Content module provides some extra utilities to simplify common use cases like building breadcrumb navigation.

### `findPageHeadline(navigation, path, options?)`

Returns the headline (name of the parent folder) for a given path within a navigation tree. Useful for displaying section titles or contextual navigation headers.

- `navigation`: The navigation tree (array of ContentNavigationItem).
- `path`: The current page path.
- `options` (optional):
- `indexAsChild`: Treat index pages as children.

**Example:**

```ts
import { findPageHeadline } from '@nuxt/content/utils'

const headline = findPageHeadline(navigation, '/docs/guide/getting-started')
// headline is a string that contains the name of the parent folder
```

### `findPageBreadcrumb(navigation, path, options?)`

Returns the breadcrumb trail (array of navigation items) for a given path within a navigation tree. Useful for building breadcrumb navigation components.
Expand Down