Skip to content

Commit 31a37d0

Browse files
committed
category descriptions
1 parent 22458b2 commit 31a37d0

File tree

4 files changed

+23
-22
lines changed

4 files changed

+23
-22
lines changed

apps/svelte.dev/src/lib/packages-meta.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const SV_ADD_CMD: Record<string, { alias: string; options?: string }> = {
3838

3939
const FEATURED: {
4040
title: string;
41-
alternative?: string;
41+
description?: string;
4242
packages: string[];
4343
weights?: Record<string, number>;
4444
}[] = [
@@ -202,7 +202,7 @@ const FEATURED: {
202202
// },
203203
{
204204
title: 'Router',
205-
alternative: 'SvelteKit',
205+
description: 'SvelteKit is recommended, but here are some alternatives.',
206206
packages: [
207207
'@sveltejs/kit',
208208
'svelte-routing',
@@ -214,7 +214,7 @@ const FEATURED: {
214214
},
215215
{
216216
title: 'Data fetching',
217-
alternative: 'SvelteKit remote functions',
217+
description: 'SvelteKit remote functions are recommended, but here are some alternatives.',
218218
packages: [
219219
'@urql/svelte',
220220
'trpc-sveltekit',
@@ -226,7 +226,7 @@ const FEATURED: {
226226
},
227227
{
228228
title: 'Forms',
229-
alternative: 'SvelteKit forms',
229+
description: 'SvelteKit forms are recommended, but here are some alternatives.',
230230
packages: ['sveltekit-superforms', '@tanstack/svelte-form', 'formsnap', 'felte']
231231
}
232232
];

apps/svelte.dev/src/routes/packages/+page.server.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ const arrToPackages = (arr: string[]) => {
2121
};
2222

2323
// Netflix style page. Send pre-done cards with categories
24-
const addons: { title: string; href?: string; alternative?: string; packages: Package[] }[] = [
24+
const addons: { title: string; href?: string; description?: string; packages: Package[] }[] = [
2525
{
2626
title: 'Svelte CLI add-ons',
27-
href: '/docs/cli',
27+
description: 'sv, the Svelte CLI, lets you instantly add functionality to a new or existing project.',
2828
packages: arrToPackages(PACKAGES_META.SV_ADD.packages).map((pkg) => {
2929
pkg.name = pkg.svCmdAlias ?? pkg.name;
3030
pkg.homepage = `/docs/cli/${pkg.svCmdAlias}`;
@@ -34,12 +34,12 @@ const addons: { title: string; href?: string; alternative?: string; packages: Pa
3434
}
3535
];
3636

37-
const homepage: { title: string; href?: string; alternative?: string; packages: Package[] }[] = [];
37+
const homepage: { title: string; href?: string; description?: string; packages: Package[] }[] = [];
3838

39-
for (const { packages, title, alternative } of PACKAGES_META.FEATURED) {
39+
for (const { packages, title, description } of PACKAGES_META.FEATURED) {
4040
homepage.push({
4141
title,
42-
alternative,
42+
description,
4343
packages: arrToPackages(packages)
4444
});
4545
}

apps/svelte.dev/src/routes/packages/+page.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222

2323
<div class="page content">
2424
<div in:fly={{ y: 20 }}>
25-
{#each data.addons as { title, alternative, href, packages }}
26-
<Category {title} {alternative} {href} {packages} />
25+
{#each data.addons as { title, description, href, packages }}
26+
<Category {title} {description} {href} {packages} />
2727
{/each}
28-
{#each data.homepage as { title, alternative, href, packages }}
29-
<Category {title} {alternative} {href} {packages} />
28+
{#each data.homepage as { title, description, href, packages }}
29+
<Category {title} {description} {href} {packages} />
3030
{/each}
3131
</div>
3232
</div>

apps/svelte.dev/src/routes/packages/Category.svelte

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66
interface Props {
77
title: string;
88
packages: Package[];
9-
alternative?: string;
10-
href?: string;
9+
description?: string;
1110
}
1211
13-
let { title, alternative, href, packages }: Props = $props();
12+
let { title, description, packages }: Props = $props();
1413
1514
let content: HTMLElement;
1615
let scroller: HTMLElement;
@@ -41,12 +40,6 @@
4140
<header>
4241
<h2>
4342
{title}
44-
{#if href}
45-
(<a {href}>docs</a>)
46-
{/if}
47-
{#if alternative}
48-
(if not using {alternative})
49-
{/if}
5043
</h2>
5144

5245
{#if !at_start || !at_end}
@@ -59,6 +52,9 @@
5952
</div>
6053
{/if}
6154
</header>
55+
{#if description}
56+
<h3>{description}</h3>
57+
{/if}
6258

6359
<div class="wrapper">
6460
<!-- we duplicate the DOM for the sake of the gradient effect -
@@ -140,6 +136,11 @@
140136
}
141137
}
142138
139+
h3 {
140+
font: var(--sk-font-ui-medium);
141+
font-size: 1.5rem;
142+
}
143+
143144
.wrapper {
144145
position: relative;
145146
}

0 commit comments

Comments
 (0)