diff --git a/apps/svelte.dev/src/lib/packages-meta.ts b/apps/svelte.dev/src/lib/packages-meta.ts index 35a04f7a0f..03be0a1599 100644 --- a/apps/svelte.dev/src/lib/packages-meta.ts +++ b/apps/svelte.dev/src/lib/packages-meta.ts @@ -8,7 +8,7 @@ const FEATURED: { { title: 'Svelte CLI add-ons', description: - 'sv, the Svelte CLI, lets you instantly add functionality to a new or existing project.', + 'The Svelte CLI lets you instantly add functionality to a new or existing project with npx sv add.', packages: [ { name: 'tailwindcss', svAlias: 'tailwind' }, { name: 'drizzle-orm', svAlias: 'drizzle' }, @@ -243,12 +243,6 @@ const FEATURED: { { name: 'felte' }, { name: '@tanstack/svelte-form' } ] - }, - { - title: 'More', - description: - 'These are just a few highlights. See a larger directory of packages at sveltesociety.dev.', - packages: [] } ]; diff --git a/apps/svelte.dev/src/routes/packages/+page.svelte b/apps/svelte.dev/src/routes/packages/+page.svelte index 129ebf6640..684ba79c50 100644 --- a/apps/svelte.dev/src/routes/packages/+page.svelte +++ b/apps/svelte.dev/src/routes/packages/+page.svelte @@ -1,6 +1,5 @@ @@ -13,10 +12,16 @@ -

Packages

-
-
+
+

Packages

+

+ We've collected a few of our favourite packages that work well with Svelte and SvelteKit apps. + Official packages are marked with the logo. +

+
+ +
{#each data.homepage as { title, description, packages }} {/each} @@ -33,7 +38,24 @@ text-wrap: balance; } - .page :global(:where(h2, h3) code) { - all: unset; + header { + margin: 0 0 4rem 0; + } + + h1 { + margin: 0 0 2rem 0; + } + + .svelte-logo { + position: relative; + top: 0.15em; + display: inline-block; + width: 1em; + aspect-ratio: 1; + background: #ff3e00; + mask-size: contain; + mask-image: url(icons/svelte-cutout); + mask-repeat: no-repeat; + mask-position: 50% 50%; } diff --git a/apps/svelte.dev/src/routes/packages/Category.svelte b/apps/svelte.dev/src/routes/packages/Category.svelte index 9af1971a6c..4c532f646b 100644 --- a/apps/svelte.dev/src/routes/packages/Category.svelte +++ b/apps/svelte.dev/src/routes/packages/Category.svelte @@ -1,6 +1,6 @@ - -
-
-

- {title} -

- - {#if !at_start || !at_end} -
- - - -
- {/if} -
+

+ {title} +

+ {#if description} -

{@html description}

+

{@html description}

{/if} -
- -
-
- {#each packages as pkg} -
- -
- {/each} +
+ {#each visiblePackages as pkg} +
+
-
+ {/each} +
-
{ - const left = e.currentTarget.scrollLeft; - content.style.translate = `-${left}px`; - - update(); - }} - > -
- {#each packages as pkg} -
- -
- {/each} -
+ {#if packages.length > INITIAL_ITEMS} +
+
-
+ {/if}
diff --git a/apps/svelte.dev/src/routes/packages/PackageCard.svelte b/apps/svelte.dev/src/routes/packages/PackageCard.svelte index 5e4d6d51b5..f6a4afa0d9 100644 --- a/apps/svelte.dev/src/routes/packages/PackageCard.svelte +++ b/apps/svelte.dev/src/routes/packages/PackageCard.svelte @@ -8,11 +8,20 @@ }; let { pkg }: Props = $props(); + + const formatter = new Intl.DateTimeFormat(undefined, { + weekday: 'short', + year: 'numeric', + month: 'short', + day: 'numeric', + hour: 'numeric', + minute: 'numeric' + }); -
-
- {#snippet title()} +
+ {#snippet contents()} +

{#if pkg.official} @@ -20,46 +29,56 @@ {pkg.name}

- {/snippet} - - {#if pkg.homepage} - e.stopPropagation()} - > - {@render title()} - - {:else} - {@render title()} - {/if} - - {pkg.version} - {ago(new Date(pkg.updated), true)} - -
-

{pkg.description}

+ + {pkg.version} -

- {#if pkg.downloads} - - - {format_number(+pkg.downloads)} + + {ago(new Date(pkg.updated), true)} + - {/if} +

- {#if pkg.github_stars} - - - {format_number(pkg.github_stars)} - - {/if} +

{pkg.description}

- +

+ {#if pkg.downloads} + + + {format_number(+pkg.downloads)} + + {/if} + + {#if pkg.github_stars} + + + {format_number(pkg.github_stars)} + + {/if} + +

+ {/snippet} + + {#if pkg.homepage} + e.stopPropagation()} + > + {@render contents()} + + {:else} +
+ {@render contents()} +
+ {/if} + + +