diff --git a/docs/content/docs/4.utils/2.query-collection-navigation.md b/docs/content/docs/4.utils/2.query-collection-navigation.md index 50e1acce4..d36009bbe 100644 --- a/docs/content/docs/4.utils/2.query-collection-navigation.md +++ b/docs/content/docs/4.utils/2.query-collection-navigation.md @@ -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.