Skip to content

Commit 5a25529

Browse files
authored
feat: show repo ref (#99)
1 parent 2df63c6 commit 5a25529

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

app/pages/[...package].vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ const repositoryUrl = computed(() => {
154154
return url
155155
})
156156
157-
const { meta: repoMeta, repoRef, stars, forks, forksLink } = useRepoMeta(repositoryUrl)
157+
const { meta: repoMeta, repoRef, stars, starsLink, forks, forksLink } = useRepoMeta(repositoryUrl)
158158
159159
const PROVIDER_ICONS: Record<string, string> = {
160160
github: 'i-carbon-logo-github',
@@ -513,13 +513,23 @@ defineOgImageComponent('Package', {
513513
class="link-subtle font-mono text-sm inline-flex items-center gap-1.5"
514514
>
515515
<span class="w-4 h-4" :class="repoProviderIcon" aria-hidden="true" />
516-
<span v-if="repoMeta && stars">
517-
{{ formatCompactNumber(stars, { decimals: 1 }) }}
518-
{{ stars === 1 ? 'star' : 'stars' }}
516+
<span v-if="repoRef">
517+
{{ repoRef.owner }}<span class="opacity-50">/</span>{{ repoRef.repo }}
519518
</span>
520519
<span v-else>repo</span>
521520
</a>
522521
</li>
522+
<li v-if="repositoryUrl && repoMeta && starsLink">
523+
<a
524+
:href="starsLink"
525+
target="_blank"
526+
rel="noopener noreferrer"
527+
class="link-subtle font-mono text-sm inline-flex items-center gap-1.5"
528+
>
529+
<span class="w-4 h-4 i-carbon-star" aria-hidden="true" />
530+
{{ formatCompactNumber(stars, { decimals: 1 }) }}
531+
</a>
532+
</li>
523533
<li v-if="homepageUrl">
524534
<a
525535
:href="homepageUrl"

0 commit comments

Comments
 (0)