diff --git a/organize/navigation.mdx b/organize/navigation.mdx index 421b8a9ab..5a7b8b642 100644 --- a/organize/navigation.mdx +++ b/organize/navigation.mdx @@ -116,6 +116,61 @@ Use the `root` property to designate a main page for a group. When a group has a } ``` +### Directory listings + +When a group has a root page, you can generate a directory listing on that page. The directory listing displays the group's child pages and nested groups to give users an overview of the section's content. + +Set the `directory` property on a group, tab, or the top-level `navigation` object to enable directory listings. The property accepts three values: + +| Value | Description | +|---------------|----------------------------------------------------| +| `"accordion"` | Displays child pages in a list | +| `"card"` | Displays child pages as horizontal cards | +| `"none"` | Disables directory listings (default) | + +The `directory` value inherits through the navigation hierarchy. If you set a `directory` value on a parent element, the value applies to all descendant groups unless overridden. + +```json Enable accordion directory for a group {6} +{ + "navigation": { + "groups": [ + { + "group": "API reference", + "root": "api-overview", + "directory": "accordion", + "pages": [ + "api-reference/authentication", + "api-reference/endpoints", + "api-reference/errors" + ] + } + ] + } +} +``` + +```json Enable card directory for all groups {3} +{ + "navigation": { + "directory": "card", + "groups": [ + { + "group": "Guides", + "root": "guides/overview", + "pages": [ + "guides/quickstart", + "guides/configuration" + ] + } + ] + } +} +``` + + + Directory listings only appear on group root pages. If a group does not have a `root` property, it cannot display a directory listing. + + ### Default expanded state Use the `expanded` property to control the default state of a nested group in the navigation sidebar. diff --git a/organize/settings-reference.mdx b/organize/settings-reference.mdx index 4671d91a9..6ea279187 100644 --- a/organize/settings-reference.mdx +++ b/organize/settings-reference.mdx @@ -231,6 +231,13 @@ Individual pages in your documentation. **Type:** array of string or object +#### `navigation.directory` + +Directory layout for group root pages. When set to `"accordion"` or `"card"`, groups with a `root` page display a directory listing of their child pages. Set to `"none"` to disable. Inherits recursively through the navigation hierarchy; descendants can override. + +**Type:** `"none"` | `"accordion"` | `"card"` +**Default:** `"none"` + --- ### `description` diff --git a/organize/settings-structure.mdx b/organize/settings-structure.mdx index 9a90d9703..b6098f688 100644 --- a/organize/settings-structure.mdx +++ b/organize/settings-structure.mdx @@ -201,6 +201,10 @@ See [Navigation](/organize/navigation) for complete documentation on building yo Individual [pages](/organize/navigation#pages) that make up your documentation. + + Directory layout for group root pages. Set to `"accordion"` or `"card"` to display a listing of child pages on group root pages. Set to `"none"` to disable. Inherits recursively; descendants can override. See [Directory listings](/organize/navigation#directory-listings) for more information. + + --- ### `navbar`