fix(theme): remove extra slash when concatenating base with sidebar links

---------

Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
pull/4816/head
noy4 3 months ago committed by GitHub
parent f1b1ffbdfc
commit c8fc80e438
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -112,7 +112,8 @@ function addBase(items: SidebarItem[], _base?: string): SidebarItem[] {
return [...items].map((_item) => { return [...items].map((_item) => {
const item = { ..._item } const item = { ..._item }
const base = item.base || _base const base = item.base || _base
if (base && item.link) item.link = base + item.link if (base && item.link)
item.link = base + item.link.replace(/^\//, base.endsWith('/') ? '' : '/')
if (item.items) item.items = addBase(item.items, base) if (item.items) item.items = addBase(item.items, base)
return item return item
}) })

Loading…
Cancel
Save