Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions app/pages/[...package].vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@ const docsLink = computed(() => {
}
})

const fundingUrl = computed(() => {
let funding = displayVersion.value?.funding
if (Array.isArray(funding)) funding = funding[0]

if (!funding) return null

return typeof funding === 'string' ? funding : funding.url
})

function normalizeGitUrl(url: string): string {
return url
.replace(/^git\+/, '')
Expand Down Expand Up @@ -635,6 +644,15 @@ defineOgImageComponent('Package', {
{{ $t('package.links.docs') }}
</NuxtLink>
</li>
<li v-if="fundingUrl">
<NuxtLink
:to="fundingUrl"
class="link-subtle font-mono text-sm inline-flex items-center gap-1.5"
>
<span class="i-carbon-favorite w-4 h-4" aria-hidden="true" />
{{ $t('package.links.fund') }}
</NuxtLink>
</li>
<li v-if="displayVersion" class="sm:ml-auto">
<NuxtLink
:to="{
Expand Down
3 changes: 2 additions & 1 deletion i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@
"forks": "fork | forks",
"jsr": "jsr",
"code": "code",
"docs": "docs"
"docs": "docs",
"fund": "fund"
},
"install": {
"title": "Install",
Expand Down
3 changes: 2 additions & 1 deletion i18n/locales/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@
"forks": "复刻",
"jsr": "jsr",
"code": "代码",
"docs": "文档"
"docs": "文档",
"fund": "资助"
},
"install": {
"title": "安装",
Expand Down