Skip to content

Commit b1ee642

Browse files
Copilotmaiertech
andauthored
Render tag pages with card grid layout (#1159)
* Initial plan * Update tag page layout to match posts page with LinkPreview card grid Co-authored-by: maiertech <1482402+maiertech@users.noreply.github.com> * Initial plan --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: maiertech <1482402+maiertech@users.noreply.github.com>
1 parent 0f4a87d commit b1ee642

1 file changed

Lines changed: 17 additions & 14 deletions

File tree

src/routes/tags/[id]/+page.svelte

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
<script lang="ts">
2+
import { H1, LinkPreview } from '@maiertech/sveltekit-helpers';
23
import type { PageProps } from './$types';
34
45
let { data }: PageProps = $props();
5-
</script>
66
7-
<h1 class="text-gradient">{data.seo.title}</h1>
7+
const links = $derived.by(() =>
8+
data.posts.map((post) => ({
9+
href: post.path,
10+
title: post.title,
11+
description: post.description
12+
}))
13+
);
14+
</script>
815

9-
<ul>
10-
{#each data.posts as post (post.path)}
11-
<li>
12-
<a href={post.path}>{post.title}</a>
13-
</li>
14-
{/each}
15-
</ul>
16+
<H1 class="mb-8">{data.seo.title}</H1>
1617

17-
<style>
18-
h1 {
19-
margin-bottom: var(--size-fluid-2);
20-
}
21-
</style>
18+
<div class="@container">
19+
<div class="grid grid-cols-1 gap-5 @lg:grid-cols-2 @4xl:grid-cols-3">
20+
{#each links as link (link.href)}
21+
<LinkPreview value={link} />
22+
{/each}
23+
</div>
24+
</div>

0 commit comments

Comments
 (0)