diff --git a/apps/web/src/pages/plugins/[slug].astro b/apps/web/src/pages/plugins/[slug].astro index 79c88348b..2ae791bca 100644 --- a/apps/web/src/pages/plugins/[slug].astro +++ b/apps/web/src/pages/plugins/[slug].astro @@ -73,11 +73,8 @@ const formatCount = (count?: number): string => { const { slug: id } = Astro.params const { title, description, githubStars, npmDownloads, href, name, tutorial, icon, author } = plugin as Plugin -const npmHref = name ? `https://www.npmjs.com/package/${name}` : undefined -const docsHref = docsSlug ? getRelativeLocaleUrl(docsLocale, `docs/plugins/${docsSlug}/`) : (npmHref ?? href) -const docsIsExternal = !docsSlug -const showRepoLink = href !== docsHref -const showNpmLink = !!npmHref && npmHref !== docsHref +const npmHref = name ? `https://www.npmjs.com/package/${name}` : `https://www.npmjs.com/search?q=${encodeURIComponent(title)}` +const docsHref = docsSlug ? getRelativeLocaleUrl(docsLocale, `docs/plugins/${docsSlug}/`) : getRelativeLocaleUrl(locale, 'docs/plugins/') const content: { title?: string; description?: string; image?: string; author?: string; ldJSON?: Object } = {} @@ -105,7 +102,7 @@ content['ldJSON'] = createSoftwareApplicationLdJson(Astro.locals.runtimeConfig.p Back to plugins @@ -120,7 +117,7 @@ content['ldJSON'] = createSoftwareApplicationLdJson(Astro.locals.runtimeConfig.p href={npmHref} target="_blank" rel="noopener noreferrer" - class="rounded-full border border-blue-400/20 bg-blue-400/10 px-3 py-1 text-sm text-blue-100 transition hover:border-blue-300/40 hover:bg-blue-400/15" + class="cursor-pointer rounded-full border border-blue-400/20 bg-blue-400/10 px-3 py-1 text-sm text-blue-100 transition hover:border-blue-300/40 hover:bg-blue-400/15" > {name} @@ -147,7 +144,7 @@ content['ldJSON'] = createSoftwareApplicationLdJson(Astro.locals.runtimeConfig.p href={npmHref ?? href} target="_blank" rel="noopener noreferrer" - class="rounded-2xl border border-white/10 bg-white/[0.03] p-5 transition hover:border-white/20 hover:bg-white/[0.05]" + class="cursor-pointer rounded-2xl border border-white/10 bg-white/[0.03] p-5 transition hover:border-white/20 hover:bg-white/[0.05]" >
{m.downloads({}, { locale })}/week
@@ -158,7 +155,7 @@ content['ldJSON'] = createSoftwareApplicationLdJson(Astro.locals.runtimeConfig.p href={href} target="_blank" rel="noopener noreferrer" - class="rounded-2xl border border-white/10 bg-white/[0.03] p-5 transition hover:border-white/20 hover:bg-white/[0.05]" + class="cursor-pointer rounded-2xl border border-white/10 bg-white/[0.03] p-5 transition hover:border-white/20 hover:bg-white/[0.05]" >
{m.github_stars({}, { locale })}
@@ -173,39 +170,29 @@ content['ldJSON'] = createSoftwareApplicationLdJson(Astro.locals.runtimeConfig.p