diff --git a/src/client/app/utils.ts b/src/client/app/utils.ts index f6438cc17a83..33e0684bb3e3 100644 --- a/src/client/app/utils.ts +++ b/src/client/app/utils.ts @@ -1,6 +1,8 @@ import { siteDataRef } from './data' import { inBrowser } from '../shared' +const EXTERNAL_URL_RE = /^https?:/i + export { inBrowser } /** @@ -11,7 +13,9 @@ export function joinPath(base: string, path: string): string { } export function withBase(path: string) { - return joinPath(siteDataRef.value.base, path) + return EXTERNAL_URL_RE.test(path) + ? path + : joinPath(siteDataRef.value.base, path) } /**