diff --git a/packages/@vuepress/theme-default/components/SidebarLink.vue b/packages/@vuepress/theme-default/components/SidebarLink.vue index 243ce7630b..bc5de287d8 100644 --- a/packages/@vuepress/theme-default/components/SidebarLink.vue +++ b/packages/@vuepress/theme-default/components/SidebarLink.vue @@ -32,12 +32,13 @@ export default { ? renderExternal(h, item.path, item.title || item.path) : renderLink(h, item.path, item.title || item.path, active) - const configDepth = $page.frontmatter.sidebarDepth - || sidebarDepth - || $themeLocaleConfig.sidebarDepth - || $themeConfig.sidebarDepth - - const maxDepth = configDepth == null ? 1 : configDepth + const maxDepth = [ + $page.frontmatter.sidebarDepth, + sidebarDepth, + $themeLocaleConfig.sidebarDepth, + $themeConfig.sidebarDepth, + 1 + ].find(depth => depth !== undefined); const displayAllHeaders = $themeLocaleConfig.displayAllHeaders || $themeConfig.displayAllHeaders diff --git a/packages/docs/docs/guide/directory-structure.md b/packages/docs/docs/guide/directory-structure.md index 6c421cb67b..cf66608712 100644 --- a/packages/docs/docs/guide/directory-structure.md +++ b/packages/docs/docs/guide/directory-structure.md @@ -45,7 +45,7 @@ Please note the capitalization of the directory name. - `docs/.vuepress/enhanceApp.js`: App level enhancement. ::: warning Note -When customizing `templates/ssr.html`, or `templates/dev.html`, it is best to modify it on the basis of the [default template files](https://github.com/vuejs/vuepress/blob/master/packages/%40vuepress/core/lib/app/index.dev.html), otherwise it may cause a build failure. +When customizing `templates/ssr.html`, or `templates/dev.html`, it is best to modify it on the basis of the [default template files](https://github.com/vuejs/vuepress/blob/master/packages/%40vuepress/core/lib/client/index.dev.html), otherwise it may cause a build failure. ::: ## Default Page Routing