Files
markdown/docs/1.简单文档/3.writing/3.folders.md
2025-08-08 10:01:03 +08:00

58 lines
1.6 KiB
Markdown

---
title: 目录
description: 通过 YML 文件配置目录节点。
navigation:
icon: lucide:folder
---
You can customize folders by creating a `_dir.yml` file in the folder.
::code-group
```yml [_dir.yml]
title: Folder
icon: lucide:folder
navigation.redirect: /frameworks/vue
navBadges:
- value: New
type: lime
sidebar:
style: group
collapse: false
```
```[Directory structure]
content/
1.frameworks/
_dir.yml
1.vue.md
2.nuxt.md
```
::
## Parameters
::field-group
::field{name="title" type="string"}
Title of the page. Defaults to the filename.
::
::field{name="icon" type="string"}
The icon shown in the sidebar for the page.
::
::field{name="navBadges" type="[]"}
A list of badges appended to the end of the sidebar link.
::
::field{name="collapse" type="boolean"}
Whether the folder should be collapsed by default.
::
::field{name="sidebar" type="object"}
::collapsible{title="Details" default-open}
::field{name="style" type="'default' | 'tree' | 'group'" default-value="default"}
The style used for the folder. The default value can be configured in the [appConfig](/api/configuration/shadcn-docs#aside).
| `default` | `tree` | `group` |
| :-------------------------------------------------: | :-------------------------------------------: | :---------------------------------------------: |
| ![sidebar-default](/sidebar-default.png){width=400} | ![sidebar-tree](/sidebar-tree.png){width=400} | ![sidebar-group](/sidebar-group.png){width=400} |
::
::
::
::