Skip to content

Commit 704b712

Browse files
committed
update sv add-ons title
1 parent 515cb55 commit 704b712

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

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

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

2323
// Netflix style page. Send pre-done cards with categories
24-
const homepage_data: { title: string; packages: Package[] }[] = [
24+
const homepage: { title: string; href?: string; packages: Package[] }[] = [
2525
{
26-
title: 'sv add-ons',
26+
title: 'Svelte CLI add-ons',
27+
href: '/docs/cli',
2728
packages: arrToPackages(PACKAGES_META.SV_ADD.packages)
2829
}
2930
];
3031

3132
for (const { packages, title } of PACKAGES_META.FEATURED) {
32-
homepage_data.push({
33+
homepage.push({
3334
title,
3435
packages: arrToPackages(packages)
3536
});
3637
}
3738

38-
export async function load({ url }) {
39+
export async function load() {
3940
return {
4041
packages: registry,
41-
homepage: homepage_data
42+
homepage
4243
};
4344
}

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

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

2323
<div class="page content">
2424
<div in:fly={{ y: 20 }}>
25-
{#each data.homepage as { title, packages }}
26-
<Category {title} {packages} />
25+
{#each data.homepage as { title, href, packages }}
26+
<Category {title} {href} {packages} />
2727
{/each}
2828
</div>
2929
</div>

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
packages: Package[];
99
}
1010
11-
let { title, packages }: Props = $props();
11+
let { title, href, packages }: Props = $props();
1212
1313
let content: HTMLElement;
1414
let scroller: HTMLElement;
@@ -37,7 +37,12 @@
3737

3838
<section class="category">
3939
<header>
40-
<h2>{title}</h2>
40+
<h2>
41+
{title}
42+
{#if href}
43+
(<a {href}>docs</a>)
44+
{/if}
45+
</h2>
4146

4247
{#if !at_start || !at_end}
4348
<div class="controls">

0 commit comments

Comments
 (0)