From 7972acb40ff6d77b6c3a766615ce26c0f0c38edc Mon Sep 17 00:00:00 2001 From: June Date: Tue, 18 Nov 2025 12:27:01 +1300 Subject: [PATCH] Add tag page --- web/src/pages/posts/tag/[tag].astro | 33 +++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/web/src/pages/posts/tag/[tag].astro b/web/src/pages/posts/tag/[tag].astro index 874f123..f09cbcd 100644 --- a/web/src/pages/posts/tag/[tag].astro +++ b/web/src/pages/posts/tag/[tag].astro @@ -1,4 +1,33 @@ --- +import Base from "@layout/Base" +import PostCard from '@components/postList/postCard' +import { authPB } from "@utils/pocketbase" +export const prerender = false + +const { tag } = Astro.params +const pb = await authPB() + +const posts = await pb.collection('posts').getFullList({ + sort: '-publishDate', + filter: `tags ~ "${tag}" && published=true` +}) + +const postCount = posts.length +const plural = postCount === 1 ? "post" : "posts" +--- -export const prerender = false ---- \ No newline at end of file + + +
+ Back + +

{postCount} {plural} with tag {tag}

+
+ +
+ { + posts.map(p => ) + } +
+ + \ No newline at end of file