-
Notifications
You must be signed in to change notification settings - Fork 226
Improve directory listings documentation #5259
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mintlify
wants to merge
4
commits into
main
Choose a base branch
from
mintlify/directory-docs-followup-1775775250
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+39
−37
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| --- | ||||||
| title: "Navigation" | ||||||
| description: "Configure your documentation site navigation with groups, pages, dropdowns, tabs, and anchors in docs.json to build a sidebar structure." | ||||||
| keywords: ["navigation structure", "sidebar configuration", "page organization", "navigation groups"] | ||||||
| --- | ||||||
|
|
||||||
|
|
@@ -118,68 +118,71 @@ | |||||
|
|
||||||
| ### 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. | ||||||
| Use the `directory` property to automatically render a directory of child pages on group root pages. When you set `directory` on a navigation element, any group with a `root` page beneath that element displays a listing of its pages below the page content. | ||||||
|
|
||||||
| Set the `directory` property on a group, tab, or the top-level `navigation` object to enable directory listings. The property accepts three values: | ||||||
| The `directory` 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) | | ||||||
| | Value | Behavior | | ||||||
| | :---------- | :------- | | ||||||
| | `"none"` | No directory listing. Default value. | | ||||||
| | `"accordion"` | Displays child pages in a collapsible list grouped by section. | | ||||||
| | `"card"` | Displays child pages in a horizontal card layout. | | ||||||
|
|
||||||
| 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. | ||||||
| The `directory` value inherits recursively through the navigation tree. Set it on a parent navigation element and all descendant groups inherit the same value. Any descendant can override the inherited value by setting `"directory": "none"`. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ```json Enable accordion directory for a group {6} | ||||||
| You can set `directory` anywhere in the navigation object in your `docs.json` file, including on tabs, anchors, dropdowns, products, versions, languages, and individual groups. | ||||||
|
|
||||||
| ```json | ||||||
| { | ||||||
| "navigation": { | ||||||
| "groups": [ | ||||||
| { | ||||||
| "group": "API reference", | ||||||
| "root": "api-overview", | ||||||
| "group": "Help Center", | ||||||
| "root": "help/index", | ||||||
| "directory": "accordion", | ||||||
| "pages": [ | ||||||
| "api-reference/authentication", | ||||||
| "api-reference/endpoints", | ||||||
| "api-reference/errors" | ||||||
| { | ||||||
| "group": "Getting Started", | ||||||
| "root": "help/getting-started/index", | ||||||
| "pages": [ | ||||||
| "help/getting-started/quickstart", | ||||||
| "help/getting-started/install" | ||||||
| ] | ||||||
| }, | ||||||
| { | ||||||
| "group": "API Reference", | ||||||
| "root": "help/api/index", | ||||||
| "directory": "none", | ||||||
| "pages": [ | ||||||
| "help/api/overview", | ||||||
| "help/api/endpoints" | ||||||
| ] | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| ```json Enable card directory for all groups {3} | ||||||
| { | ||||||
| "navigation": { | ||||||
| "directory": "card", | ||||||
| "groups": [ | ||||||
| { | ||||||
| "group": "Guides", | ||||||
| "root": "guides/overview", | ||||||
| "pages": [ | ||||||
| "guides/quickstart", | ||||||
| "guides/configuration" | ||||||
| ] | ||||||
| } | ||||||
| ] | ||||||
| } | ||||||
| } | ||||||
| ``` | ||||||
| In this example: | ||||||
| - **Help Center** uses `"accordion"` and its root page displays a directory listing. | ||||||
| - **Getting Started** inherits `"accordion"` from its parent and also displays a directory listing. | ||||||
| - **API Reference** overrides with `"none"`, so its root page does not display a directory listing. | ||||||
|
|
||||||
| <Note> | ||||||
| Directory listings only appear on group root pages. If a group does not have a `root` property, it cannot display a directory listing. | ||||||
| The `directory` property only affects groups that have a `root` page. Groups without a `root` page are not affected. | ||||||
| </Note> | ||||||
|
|
||||||
| ### Default expanded state | ||||||
|
|
||||||
| Use the `expanded` property to control the default state of a nested group in the navigation sidebar. | ||||||
|
|
||||||
| - `expanded: true`: Group is expanded by default. | ||||||
| - `expanded: false` or omitted: Group is collapsed by default. | ||||||
|
|
||||||
| <Note> | ||||||
| The `expanded` property only affects nested groups--groups within groups. Top-level groups are always expanded and cannot be collapsed. | ||||||
| </Note> | ||||||
|
|
||||||
| ```json | ||||||
|
|
@@ -435,9 +438,9 @@ | |||||
| } | ||||||
| ``` | ||||||
|
|
||||||
| ## Dropdowns | ||||||
|
|
||||||
| Dropdowns are an expandable menu at the top of your sidebar navigation. Each item in a dropdown directs to a section of your documentation. | ||||||
|
|
||||||
| <img | ||||||
| className="block dark:hidden pointer-events-none" | ||||||
|
|
@@ -1006,9 +1009,9 @@ | |||||
|
|
||||||
| </CodeGroup> | ||||||
|
|
||||||
| ## Breadcrumbs | ||||||
|
|
||||||
| Breadcrumbs display the full navigation path at the top of pages. Some themes have breadcrumbs enabled by default and others do not. You can control whether breadcrumbs display on your site using the `styling` property in your `docs.json`. | ||||||
|
|
||||||
| <CodeGroup> | ||||||
|
|
||||||
|
|
||||||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.