We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d4f2504 + 2cd6669 commit 9a20462Copy full SHA for 9a20462
app/tags/[tag]/page/[page]/page.tsx
@@ -11,10 +11,10 @@ export const generateStaticParams = async () => {
11
const tagCounts = tagData as Record<string, number>
12
return Object.keys(tagCounts).flatMap((tag) => {
13
const postCount = tagCounts[tag]
14
- const totalPages = Math.ceil(postCount / POSTS_PER_PAGE)
15
- return Array.from({ length: totalPages - 1 }, (_, i) => ({
+ const totalPages = Math.max(1, Math.ceil(postCount / POSTS_PER_PAGE))
+ return Array.from({ length: totalPages }, (_, i) => ({
16
tag: encodeURI(tag),
17
- page: (i + 2).toString(),
+ page: (i + 1).toString(),
18
}))
19
})
20
}
0 commit comments