mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
fix(theme): normalize blog&category path
This commit is contained in:
parent
57872ce288
commit
7d12839838
@ -39,7 +39,9 @@ export const setupPlugins = (
|
||||
const localeNotesDirs = Object.keys(locales)
|
||||
.map((locale) => {
|
||||
const dir = locales[locale].notes?.dir || ''
|
||||
return dir ? path.join(locale, dir, '**').replace(/^\//, '') : ''
|
||||
return dir
|
||||
? path.join(locale, dir, '**').replace(/\\+/g, '/').replace(/^\//, '')
|
||||
: ''
|
||||
})
|
||||
.filter(Boolean)
|
||||
|
||||
|
||||
@ -43,7 +43,8 @@ export function autoCategory(
|
||||
const notesLinks: string[] = []
|
||||
for (const [, locale] of locales.entries()) {
|
||||
const notes = options.locales?.[locale]?.notes
|
||||
if (notes && notes.link) notesLinks.push(path.join(locale, notes.link))
|
||||
if (notes && notes.link)
|
||||
notesLinks.push(path.join(locale, notes.link).replace(/\\+/g, '/'))
|
||||
}
|
||||
if (notesLinks.some((link) => page.path.startsWith(link))) return
|
||||
const RE_LOCALE = new RegExp(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user