We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b505e7 commit fbd948aCopy full SHA for fbd948a
1 file changed
app/tags/[tag]/page.tsx
@@ -26,14 +26,16 @@ export async function generateMetadata(props: {
26
})
27
}
28
29
-export const generateStaticParams = async () => {
30
- const tagCounts = tagData as Record<string, number>
31
- const tagKeys = Object.keys(tagCounts)
32
- return tagKeys.map((tag) => ({
33
- tag: encodeURI(tag),
+export async function generateStaticParams() {
+ const blogs = allBlogs.map((post) => post.tags || []).flat()
+ const allTags = [...new Set([...blogs])]
+
+ return allTags.map((tag) => ({
34
+ tag: tag,
35
}))
36
37
38
39
export default async function TagPage(props: { params: Promise<{ tag: string }> }) {
40
const params = await props.params
41
const tag = decodeURI(params.tag)
0 commit comments