diff --git a/theme/src/client/components/Sidebar.vue b/theme/src/client/components/Sidebar.vue
index bee593a0..55e421c2 100644
--- a/theme/src/client/components/Sidebar.vue
+++ b/theme/src/client/components/Sidebar.vue
@@ -52,7 +52,11 @@ watch(
Sidebar Navigation
-
+
diff --git a/theme/src/client/components/TransitionDrop.vue b/theme/src/client/components/TransitionDrop.vue
index 39e24ed6..83d86774 100644
--- a/theme/src/client/components/TransitionDrop.vue
+++ b/theme/src/client/components/TransitionDrop.vue
@@ -21,7 +21,7 @@ function setStyle(item: Element) {
if (!_transition) {
const value = typeof window !== 'undefined' && window.getComputedStyle ? window.getComputedStyle(el).transition : ''
- _transition = value && !value.includes('all') ? `${value}, ` : ''
+ _transition = value && !value.includes('all') ? `${value}, ` : ' '
}
el.style.transition = `${_transition}transform ${props.duration}s ease-in-out ${props.delay}s, opacity ${props.duration}s ease-in-out ${props.delay}s`
diff --git a/theme/src/client/composables/sidebar.ts b/theme/src/client/composables/sidebar.ts
index 16e192cd..52e3dc1f 100644
--- a/theme/src/client/composables/sidebar.ts
+++ b/theme/src/client/composables/sidebar.ts
@@ -23,7 +23,26 @@ export function getSidebarList(path: string, notesData: NotesData) {
const link = Object.keys(notesData).find(link =>
path.startsWith(normalizePath(link)),
)
- return link ? notesData[link] : []
+ const sidebar = link ? notesData[link] : []
+
+ const groups: NotesSidebarItem[] = []
+
+ let lastGroupIndex: number = 0
+
+ for (const index in sidebar) {
+ const item = sidebar[index]
+
+ if (item.items && item.items.length) {
+ lastGroupIndex = groups.push(item)
+ continue
+ }
+
+ if (!groups[lastGroupIndex])
+ groups.push({ items: [] })
+
+ groups[lastGroupIndex]!.items!.push(item)
+ }
+ return groups
}
export function getSidebarFirstLink(sidebar: NotesSidebarItem[]) {