From b4e4d662a24da2b3bf57332293776f5cd46cc442 Mon Sep 17 00:00:00 2001 From: satnaing Date: Mon, 7 Oct 2024 20:37:51 +0700 Subject: [PATCH] fix: remove redundant [page].tsx in tags --- src/pages/tags/[tag]/[page].astro | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 src/pages/tags/[tag]/[page].astro diff --git a/src/pages/tags/[tag]/[page].astro b/src/pages/tags/[tag]/[page].astro deleted file mode 100644 index 5ca65a070..000000000 --- a/src/pages/tags/[tag]/[page].astro +++ /dev/null @@ -1,29 +0,0 @@ ---- -import { getCollection } from "astro:content"; -import TagPosts from "@layouts/TagPosts.astro"; -import getUniqueTags from "@utils/getUniqueTags"; -import getPostsByTag from "@utils/getPostsByTag"; -import type { GetStaticPathsOptions } from "astro"; -import { SITE } from "@config"; - -export async function getStaticPaths({ paginate }: GetStaticPathsOptions) { - const posts = await getCollection("blog"); - const tags = getUniqueTags(posts); - - return tags.flatMap(({ tag, tagName }) => { - const tagPosts = getPostsByTag(posts, tag); - - return paginate(tagPosts, { - params: { tag }, - props: { tagName }, - pageSize: SITE.postPerPage, - }); - }); -} - -const params = Astro.params; -const { tag } = params; -const { page, tagName } = Astro.props; ---- - -