Skip to content

Commit

Permalink
improve frontmatter tutorial.
Browse files Browse the repository at this point in the history
  • Loading branch information
M1hono committed Aug 22, 2024
1 parent 876d4f0 commit 09f9ac8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 174 deletions.
99 changes: 12 additions & 87 deletions docs/en/doc/sidebarTutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,93 +29,18 @@ At the beginning of each Markdown file, use `---` to separate the front matter s

Available front matter fields:

1. title

Purpose: Sets the title of the document
Type: String
Example:
yamlCopytitle: Getting Started Guide


2. sidetitle

Purpose: Sets the title displayed in the sidebar (if not set, the title is used)
Type: String
Example:
yamlCopysidetitle: Quick Start


3. sidebarorder

Purpose: Customizes the order of documents and subdirectories in the current directory
Type: Object
Example:
yamlCopysidebarorder:
index: -1
introduction: 1
advanced: 2


4. tagDisplay

Purpose: Enables tag grouping display
Type: Boolean
Example:
yamlCopytagDisplay: true


5. back

Purpose: Customizes the path to return to the parent directory
Type: String
Example:
yamlCopyback: /guide/


6. autoPN

Purpose: Automatically generates previous/next navigation
Type: Boolean
Example:
yamlCopyautoPN: true


7. tagorder

Purpose: Customizes the order of tags
Type: Object
Example:
yamlCopytagorder:
Basics: 1
Advanced: 2


8. folderBlackList

Purpose: Specifies the list of folders to exclude from the sidebar
Type: Array
Example:
yamlCopyfolderBlackList:
- private
- drafts


9. generateSidebar

Purpose: Includes the current index.md file in the sidebar
Type: Boolean
Default: false
Example:
yamlCopygenerateSidebar: true


10. tag/s

Purpose: Specifies tags for the document (used for tag grouping display). When used in a index.md, It should be tags for taging this folder.
Type: String
Example:
yamlCopytag: Basics

| Field | Purpose | Type | Example |
| -------------- | -------------------------------------------- | ------- | -------------------------------------------- |
| `title` | Set the title of the document | String | `title: Getting Started` |
| `sidetitle` | Set the title displayed in the sidebar | String | `sidetitle: Quick Start` |
| `sidebarorder` | Customize the order of documents and subfolders in the current directory | Object | `sidebarorder: \n index: -1 \n introduction: 1 \n advanced: 2` |
| `tagDisplay` | Enable tag grouping display | Boolean | `tagDisplay: true` |
| `back` | Customize the path to navigate back to the parent directory | String | `back: /guide/` |
| `autoPN` | Automatically generate previous/next navigation | Boolean | `autoPN: true` |
| `tagorder` | Customize the order of tags | Object | `tagorder: \n Basics: 1 \n Advanced: 2` |
| `folderBlackList` | Specify a list of folders to exclude from the sidebar | Array | `folderBlackList: \n - private \n - drafts` |
| `generateSidebar` | Include the current `index.md` file in the sidebar | Boolean | `generateSidebar: true` |
| `tag` | Specify a tag for the document (used for tag grouping display) | String | `tag: Basics` |

Complete example
Here is an example of the front matter configuration for an index.md file that includes all available configurations:
Expand Down
99 changes: 12 additions & 87 deletions docs/zh/doc/sidebarTutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,93 +29,18 @@ next:

可用的前置配置字段

1. title

目的:设置文档的标题
类型:字符串
示例:
yamlCopytitle: 入门指南


2. sidetitle

目的:设置侧边栏中显示的标题(如果未设置,则使用标题)
类型:字符串
示例:
yamlCopysidetitle: 快速入门


3. sidebarorder

目的:自定义当前目录中文档和子目录的顺序
类型:对象
示例:
yamlCopysidebarorder:
index: -1
introduction: 1
advanced: 2


4. tagDisplay

目的:启用标签分组显示
类型:布尔值
示例:
yamlCopytagDisplay: true


5. back

目的:自定义返回到父目录的路径
类型:字符串
示例:
yamlCopyback: /guide/


6. autoPN

目的:自动生成上一篇/下一篇导航
类型:布尔值
示例:
yamlCopyautoPN: true


7. tagorder

目的:自定义标签的顺序
类型:对象
示例:
yamlCopytagorder:
Basics: 1
Advanced: 2


8. folderBlackList

目的:指定要在侧边栏中排除的文件夹列表
类型:数组
示例:
yamlCopyfolderBlackList:
- private
- drafts


9. generateSidebar

目的:在侧边栏中包含当前的 index.md 文件
类型:布尔值
默认值:false
示例:
yamlCopygenerateSidebar: true


10. tag

目的:为文档指定标签(用于标签分组显示)
类型:字符串
示例:
yamlCopytag: 基础知识

| 配置字段 | 目的 | 类型 | 示例 |
| ------------- | ----------------------------------- | ------ | ---- |
| `title` | 设置文档的标题 | 字符串 | `title: 入门指南` |
| `sidetitle` | 设置侧边栏中显示的标题(如果未设置,则使用标题) | 字符串 | `sidetitle: 快速入门` |
| `sidebarorder`| 自定义当前目录中文档和子目录的顺序 | 对象 | `sidebarorder: \n index: -1 \n introduction: 1 \n advanced: 2` |
| `tagDisplay` | 启用标签分组显示 | 布尔值 | `tagDisplay: true` |
| `back` | 自定义返回到父目录的路径 | 字符串 | `back: /guide/` |
| `autoPN` | 自动生成上一篇/下一篇导航 | 布尔值 | `autoPN: true` |
| `tagorder` | 自定义标签的顺序 | 对象 | `tagorder: \n Basics: 1 \n Advanced: 2` |
| `folderBlackList` | 指定要在侧边栏中排除的文件夹列表 | 数组 | `folderBlackList: \n - private \n - drafts` |
| `generateSidebar` | 在侧边栏中包含当前的 `index.md` 文件 | 布尔值 | `generateSidebar: true` |
| `tag` | 为文档指定标签(用于标签分组显示) | 字符串 | `tag: 基础知识` |

完整示例
以下是一个包含所有可用配置的 index.md 文件的前置配置示例:
Expand Down

0 comments on commit 09f9ac8

Please sign in to comment.