File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -183,6 +183,15 @@ const docsLink = computed(() => {
183183 }
184184})
185185
186+ const fundingUrl = computed (() => {
187+ let funding = displayVersion .value ?.funding
188+ if (Array .isArray (funding )) funding = funding [0 ]
189+
190+ if (! funding ) return null
191+
192+ return typeof funding === ' string' ? funding : funding .url
193+ })
194+
186195function normalizeGitUrl(url : string ): string {
187196 return url
188197 .replace (/ ^ git\+ / , ' ' )
@@ -635,6 +644,15 @@ defineOgImageComponent('Package', {
635644 {{ $t('package.links.docs') }}
636645 </NuxtLink >
637646 </li >
647+ <li v-if =" fundingUrl" >
648+ <NuxtLink
649+ :to =" fundingUrl"
650+ class =" link-subtle font-mono text-sm inline-flex items-center gap-1.5"
651+ >
652+ <span class =" i-carbon-favorite w-4 h-4" aria-hidden =" true" />
653+ {{ $t('package.links.fund') }}
654+ </NuxtLink >
655+ </li >
638656 <li v-if =" displayVersion" class =" sm:ml-auto" >
639657 <NuxtLink
640658 :to =" {
Original file line number Diff line number Diff line change 104104 "forks" : " fork | forks" ,
105105 "jsr" : " jsr" ,
106106 "code" : " code" ,
107- "docs" : " docs"
107+ "docs" : " docs" ,
108+ "fund" : " fund"
108109 },
109110 "install" : {
110111 "title" : " Install" ,
Original file line number Diff line number Diff line change 102102 "forks" : " 复刻" ,
103103 "jsr" : " jsr" ,
104104 "code" : " 代码" ,
105- "docs" : " 文档"
105+ "docs" : " 文档" ,
106+ "fund" : " 资助"
106107 },
107108 "install" : {
108109 "title" : " 安装" ,
You can’t perform that action at this time.
0 commit comments