From 41116562fd9f9eacd0a81fbfed366f2c51600005 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Mon, 24 Feb 2025 00:52:29 +0800 Subject: [PATCH] chore: tweak --- theme/src/client/composables/copyright.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/theme/src/client/composables/copyright.ts b/theme/src/client/composables/copyright.ts index eb60b40e..8ef8ebd9 100644 --- a/theme/src/client/composables/copyright.ts +++ b/theme/src/client/composables/copyright.ts @@ -1,7 +1,7 @@ import type { ComputedRef } from 'vue' import type { CopyrightFrontmatter, CopyrightLicense, CopyrightOptions, GitContributor, KnownCopyrightLicense } from '../../shared/index.js' import { computed } from 'vue' -import { useRoute, useRouteLocale } from 'vuepress/client' +import { useRouteLocale } from 'vuepress/client' import { useContributors } from './contributors.js' import { useData } from './data.js' import { getPresetLocaleData } from './preset-locales.js' @@ -39,7 +39,6 @@ const LICENSE_URL: Record) { const { theme } = useData<'post'>() - const route = useRoute() const routeLocale = useRouteLocale() const { contributors } = useContributors() @@ -53,7 +52,9 @@ export function useCopyright(copyright: ComputedRef) { const sourceUrl = computed(() => { if (creation.value === 'original') { - const url = new URL(__VUEPRESS_SSR__ ? route.fullPath : location.href.split('#')[0]) + if (__VUEPRESS_SSR__) + return '' + const url = new URL(location.href.split('#')[0]) // When using giscus for comments, the redirect link after // logging in contains additional parameters. url.searchParams.delete('giscus')