diff --git a/src/client/theme-default/components/SideBar.ts b/src/client/theme-default/components/SideBar.ts index fff731e2..d12e3f20 100644 --- a/src/client/theme-default/components/SideBar.ts +++ b/src/client/theme-default/components/SideBar.ts @@ -1,4 +1,9 @@ -import { usePageData, useRoute, useSiteDataByRoute } from 'vitepress' +import { + usePageData, + useRoute, + useSiteDataByRoute, + useSiteData +} from 'vitepress' import { computed, h, FunctionalComponent, VNode } from 'vue' import { Header } from '../../../../types/shared' import { isActive, getPathDirName } from '../utils' @@ -9,12 +14,14 @@ const SideBarItem: FunctionalComponent<{ item: ResolvedSidebarItem }> = (props) => { const { - item: { link, text, children } + item: { link: relLink, text, children } } = props const route = useRoute() const pageData = usePageData() + const siteData = useSiteData() + const link = `${siteData.value.base}${relLink || ''}` const active = isActive(route, link) const headers = pageData.value.headers