diff --git a/.vitepress/theme/components/indexFilter.js b/.vitepress/theme/components/indexFilter.js index 87cd988f3..6202981eb 100644 --- a/.vitepress/theme/components/indexFilter.js +++ b/.vitepress/theme/components/indexFilter.js @@ -1,9 +1,10 @@ -const { themeConfig: { sidebar }} = global.VITEPRESS_CONFIG.site +const { base, themeConfig: { sidebar }} = global.VITEPRESS_CONFIG.site +import { join } from 'node:path' export default (pages, basePath) => { let items = findInItems(basePath, sidebar) || [] items = items.map(item => { return { ...item, link: item.link.replace(/\.md$/, '') }}) - const itemLinks = items.map(item => item.link) + const itemLinks = items.map(item => join(base, item.link)) return pages .map(p => {