Update sidebar.ts
全部默认收起,防止开发指南翻半天才能找到需要的模块,并和官网特性同步
This commit is contained in:
@@ -102,7 +102,7 @@ async function generateSidebar(): Promise<Record<string, SidebarItem[]>> {
|
|||||||
text: displayText,
|
text: displayText,
|
||||||
items: [],
|
items: [],
|
||||||
order,
|
order,
|
||||||
collapsed: i < 2 ? false : DEFAULT_COLLAPSED,
|
collapsed: DEFAULT_COLLAPSED,
|
||||||
// 为目录添加活动匹配模式
|
// 为目录添加活动匹配模式
|
||||||
activeMatch: i === 0 ? `^/${segment}(?:/|$)` : undefined
|
activeMatch: i === 0 ? `^/${segment}(?:/|$)` : undefined
|
||||||
};
|
};
|
||||||
@@ -155,4 +155,4 @@ async function getTitleFromFile(filePath: string): Promise<string> {
|
|||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default generateSidebar;
|
export default generateSidebar;
|
||||||
|
|||||||
Reference in New Issue
Block a user