Skip to content

Commit

Permalink
Merge branch 'main' into deps
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Jan 9, 2025
2 parents f39d3ca + 5a292eb commit 730ebee
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 730ebee

Please sign in to comment.