Skip to content

Commit

Permalink
fix(theme-default): fix resolvePrefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 9, 2025
1 parent 0568a46 commit 5a292eb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions themes/theme-default/src/client/utils/resolvePrefix.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { ensureEndingSlash, isLinkRelative } from '@vuepress/helper/client'
import {
ensureEndingSlash,
isLinkAbsolute,
isLinkWithProtocol,
} from '@vuepress/helper/client'

export const resolvePrefix = (prefix = '', path = ''): string =>
isLinkRelative(path) ? `${ensureEndingSlash(prefix)}${path}` : path
isLinkAbsolute(path) || isLinkWithProtocol(path)
? path
: `${ensureEndingSlash(prefix)}${path}`

0 comments on commit 5a292eb

Please sign in to comment.