From 750781d8394932ff1aff5906eab9698daea67a48 Mon Sep 17 00:00:00 2001 From: Diego Resendez Date: Thu, 24 Sep 2026 09:56:00 -0500 Subject: [PATCH] feat: give every plugin a page with its README and versions Clicking a plugin opened nothing; a developer expects what JSR shows. Each page renders the README of the newest version, lists every published version, and gives the install command for the registry the entry recommends. Signed-off-by: Diego Resendez --- src/components/PluginCard.astro | 53 ++----------------- src/components/Runtimes.astro | 56 ++++++++++++++++++++ src/pages/[slug].astro | 94 +++++++++++++++++++++++++++++++++ src/styles/global.css | 33 ++++++++++++ 4 files changed, 188 insertions(+), 48 deletions(-) create mode 100644 src/components/Runtimes.astro create mode 100644 src/pages/[slug].astro diff --git a/src/components/PluginCard.astro b/src/components/PluginCard.astro index 15a6512..ba4049b 100644 --- a/src/components/PluginCard.astro +++ b/src/components/PluginCard.astro @@ -1,13 +1,8 @@ --- -import { RUNTIMES } from '../../scripts/registry.mjs'; -// Brand marks from simple-icons (CC0), vendored rather than pulled at build time. `?raw` inlines -// them so each is one path in the HTML instead of four more requests. -import node from '../icons/nodedotjs.svg?raw'; -import deno from '../icons/deno.svg?raw'; -import bun from '../icons/bun.svg?raw'; -import workerd from '../icons/cloudflareworkers.svg?raw'; +import Runtimes from './Runtimes.astro'; interface Props { + slug: string; name: string; description: string; repo: string; @@ -18,52 +13,14 @@ interface Props { internal: boolean; } -const { name, description, repo, version, npm, jsr, runtimes, internal } = Astro.props; - -const ICONS: Record = { node, deno, bun, workerd }; -const LABELS: Record = { - node: 'Node.js', - deno: 'Deno', - bun: 'Bun', - workerd: 'workerd (Cloudflare Workers)', -}; - -// All four are always shown. Colour means the package declares it runs there; dim grey means it -// declared otherwise, or said nothing — the tooltip is what separates those two, because at a -// glance they are the same fact: you cannot use it there. -const runs = (runtime: string) => runtimes.includes(runtime); -const tooltip = (runtime: string) => { - if (runs(runtime)) return `Runs on ${LABELS[runtime]}`; - - return internal - ? `Does not run on ${LABELS[runtime]} — see the README for why` - : `${LABELS[runtime]} not declared by this package`; -}; +const { slug, name, description, repo, version, npm, jsr, runtimes, internal } = Astro.props; ---
{version} -

{name}

+

{name}

-