Skip to content

Commit

Permalink
Not collasped if siderbar item depth level 1
Browse files Browse the repository at this point in the history
  • Loading branch information
ihavecoke committed Dec 14, 2023
1 parent d116ff7 commit 7fe57e6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
9 changes: 9 additions & 0 deletions locales/zh-CN/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: 使用指南
slug: guides
sidebar_position: 1
---


# 使用指南

9 changes: 9 additions & 0 deletions locales/zh-HK/docs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: 使用指南
slug: guides
sidebar_position: 1
---


# 使用指南

3 changes: 2 additions & 1 deletion scripts/siderbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ function generateSidebarConfig(metaData, locale = "zh-HK") {

if (doc.has_child) {
sidebarItem.items = generateSidebarConfig(doc.children, locale)
sidebarItem.collapsed = true;
// not collapsed if depth = 1
sidebarItem.collapsed = doc.depth !== 1;
}

sidebarConfig.push(sidebarItem);
Expand Down

0 comments on commit 7fe57e6

Please sign in to comment.