Skip to content

Commit

Permalink
fix: fixup link related error after configurating base URL (#103)
Browse files Browse the repository at this point in the history
* fix: isActive is not working after configuring base URL

* fix: footer links have redundant base URL after configuring base URL
  • Loading branch information
YanxinTang authored Jan 13, 2024
1 parent 725ef29 commit c6d4178
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/vitepress/components/VPContentDocFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function getFlatSideBarLinks(sidebar: SidebarGroup[]): MenuItemWithLink[] {
<a
v-if="links.prev"
class="prev-link"
:href="normalizeLink(links.prev.link)"
:href="links.prev.link"
>
<span class="desc">
<VTIconChevronLeft class="vt-link-icon" />
Expand All @@ -53,7 +53,7 @@ function getFlatSideBarLinks(sidebar: SidebarGroup[]): MenuItemWithLink[] {
<a
v-if="links.next"
class="next-link"
:href="normalizeLink(links.next.link)"
:href="links.next.link"
>
<span class="desc">
{{ config.i18n?.next ?? 'Next' }}
Expand Down
2 changes: 1 addition & 1 deletion src/vitepress/support/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function isActive(
if (matchPath === undefined) {
return false
}
currentPath = normalize(`/${currentPath}`)
currentPath = withBase(normalize(`/${currentPath}`))
if (asRegex) {
return new RegExp(matchPath).test(currentPath)
} else {
Expand Down

0 comments on commit c6d4178

Please sign in to comment.