From 348484c4f71f217fe67604d93dc993972aaf9be6 Mon Sep 17 00:00:00 2001 From: hmol233 <82594500+hmol233@users.noreply.github.com> Date: Fri, 17 Sep 2021 19:42:31 +0800 Subject: [PATCH] fix: sidebar behavior --- docs/.vuepress/config.ts | 4 ++++ docs/.vuepress/config/sidebar.ts | 20 ++++++++++++++++++++ docs/development/README.md | 4 ---- docs/document/README.md | 4 ---- 4 files changed, 24 insertions(+), 8 deletions(-) diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index 35c461d95..760139079 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -74,6 +74,10 @@ export default defineUserConfig({ "底层传输", "/config/" ), + "/document/": sidebar.getDocumentSidebar( + "快速入门文档", + "/document/" + ), "/document/level-0/": sidebar.getDocumentLv0Sidebar( "小小白白话文", "/document/level-0/" diff --git a/docs/.vuepress/config/sidebar.ts b/docs/.vuepress/config/sidebar.ts index 3433d1fef..60965ded1 100644 --- a/docs/.vuepress/config/sidebar.ts +++ b/docs/.vuepress/config/sidebar.ts @@ -80,6 +80,26 @@ export function getConfigSidebar( ]; } +export function getDocumentSidebar( + title: string, + path: string +): SidebarConfigArray { + return [ + { + text: title, + children: [ + path + "install.md", + path + "config.md", + path + "command.md", + path + "document.md", + path + "level-0", + path + "level-1", + path + "level-2", + ], + }, + ]; +} + export function getDocumentLv0Sidebar( title: string, path: string diff --git a/docs/development/README.md b/docs/development/README.md index 4b62c9d74..fbea17da7 100644 --- a/docs/development/README.md +++ b/docs/development/README.md @@ -1,7 +1,3 @@ ---- -sidebar: auto ---- - # 开发指南 ## 编译文档 diff --git a/docs/document/README.md b/docs/document/README.md index 9448d8db9..e654befb9 100644 --- a/docs/document/README.md +++ b/docs/document/README.md @@ -1,7 +1,3 @@ ---- -sidebar: auto ---- - # 快速入门 > **这个章节将告诉您如何用最简单的方式获得 Xray,并且开始使用 Xray。**