mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
fix(theme): fix copyright link overflow due to excessive length (#486)
This commit is contained in:
parent
f8d32835df
commit
3eaf2908c4
@ -26,7 +26,7 @@ const {
|
||||
</p>
|
||||
<p v-if="sourceUrl">
|
||||
<span>{{ creationText }}</span>
|
||||
<VPLink :href="sourceUrl" :no-icon="creation === 'original'" data-allow-mismatch>
|
||||
<VPLink :href="sourceUrl" class="source" :no-icon="creation === 'original'" data-allow-mismatch>
|
||||
{{ decodeURIComponent(sourceUrl) }}
|
||||
</VPLink>
|
||||
</p>
|
||||
@ -54,6 +54,7 @@ const {
|
||||
}
|
||||
|
||||
.vp-doc .copyright-container p span:first-of-type {
|
||||
align-self: baseline;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@ -63,6 +64,12 @@ const {
|
||||
color: var(--vp-c-text-2);
|
||||
transition: color var(--vp-t-color);
|
||||
}
|
||||
|
||||
.vp-doc .copyright-container .source {
|
||||
flex: 1;
|
||||
width: 1px;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style>
|
||||
|
||||
@ -52,8 +52,14 @@ export function useCopyright(copyright: ComputedRef<CopyrightFrontmatter>) {
|
||||
const author = computed(() => resolveAuthor(copyright.value.author, creation.value, contributors.value))
|
||||
|
||||
const sourceUrl = computed(() => {
|
||||
if (creation.value === 'original')
|
||||
return __VUEPRESS_SSR__ ? route.fullPath : location.href.split('#')[0]
|
||||
if (creation.value === 'original') {
|
||||
const url = new URL(__VUEPRESS_SSR__ ? route.fullPath : location.href.split('#')[0])
|
||||
// When using giscus for comments, the redirect link after
|
||||
// logging in contains additional parameters.
|
||||
url.searchParams.delete('giscus')
|
||||
|
||||
return url.toString()
|
||||
}
|
||||
|
||||
return copyright.value.source
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user