Merge pull request #4 from huankong233/main

This commit is contained in:
pengzhanbo 2023-06-29 16:02:37 +08:00 committed by GitHub
commit d980c361ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,9 +13,13 @@ import type { PlumeThemePageData } from '../../shared/index.js'
import { isActive } from '../utils/index.js'
import { useThemeLocaleData } from './themeData.js'
export function normalizePath(path: string) {
return path.replace(/\/\\+/g, '/').replace(/\\+/g, '/')
}
export function getSidebarList(path: string, notesData: NotesData) {
const link = Object.keys(notesData).find((link) =>
path.startsWith(withBase(link))
path.startsWith(normalizePath(withBase(link)))
)
return link ? notesData[link] : []
}