Skip to content

Commit c8fc80e

Browse files
noy4brc-dd
andauthored
fix(theme): remove extra slash when concatenating base with sidebar links
--------- Co-authored-by: Divyansh Singh <[email protected]>
1 parent f1b1ffb commit c8fc80e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/client/theme-default/support/sidebar.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ function addBase(items: SidebarItem[], _base?: string): SidebarItem[] {
112112
return [...items].map((_item) => {
113113
const item = { ..._item }
114114
const base = item.base || _base
115-
if (base && item.link) item.link = base + item.link
115+
if (base && item.link)
116+
item.link = base + item.link.replace(/^\//, base.endsWith('/') ? '' : '/')
116117
if (item.items) item.items = addBase(item.items, base)
117118
return item
118119
})

0 commit comments

Comments
 (0)