fix(theme): sidebar prefix validation completion (#208)

This commit is contained in:
pengzhanbo 2024-09-23 04:02:21 +08:00 committed by GitHub
parent 04f488e349
commit a11166de6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -179,7 +179,10 @@ function getAllSidebar(localeOptions: PlumeThemeLocaleOptions): Record<string, S
for (const [locale, opt] of entries(localeOptions.locales || {})) {
const notes = locale === '/' ? (opt.notes || localeOptions.notes) : opt.notes
const sidebar = locale === '/' ? (opt.sidebar || localeOptions.sidebar) : opt.sidebar
locales[locale] = { ...sidebar }
locales[locale] = {}
for (const [key, value] of entries(sidebar || {})) {
locales[locale][normalizeLink(key)] = value
}
if (notes && notes.notes?.length) {
const prefix = notes.link || ''