From 147eb6835d0c45e71359175881de0ff3fb83bcba Mon Sep 17 00:00:00 2001 From: Martin Donadieu Date: Wed, 29 Apr 2026 18:07:34 +0200 Subject: [PATCH] fix plugin tutorial cta destinations --- apps/web/src/pages/plugins/[slug].astro | 63 ++++++++++--------------- 1 file changed, 25 insertions(+), 38 deletions(-) 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

{m.solutions_view_docs({}, { locale })} - { - showRepoLink && ( - - {m.view_repo({}, { locale })} - - ) - } - { - showNpmLink && ( - - {m.view_npm({}, { locale })} - - ) - } + + {m.view_repo({}, { locale })} + + + {m.view_npm({}, { locale })} +