diff --git a/src/pages/tags/[tag].astro b/src/pages/tags/[tag].astro index ab92133..ae3a8ed 100644 --- a/src/pages/tags/[tag].astro +++ b/src/pages/tags/[tag].astro @@ -16,25 +16,21 @@ export interface Props { } export async function getStaticPaths() { - const posts: CollectionEntry<"blog">[] = await getCollection("blog"); + const posts = await getCollection("blog"); const tags = getUniqueTags(posts); return tags.map(tag => { return { - params: { - tag, - }, - props: { - tag, - }, + params: { tag }, + props: { tag }, }; }); } const { tag } = Astro.props; -const posts: CollectionEntry<"blog">[] = await getCollection("blog"); +const posts = await getCollection("blog", ({ data }) => !data.draft); const tagPosts = getPostsByTag(posts, tag); ---