File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
src/app/archive/[[...slug]] Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -9,12 +9,14 @@ import CategoryList from '@/components/Archive/CategoryList'
9
9
import TaskList from '@/components/Archive/TaskList'
10
10
import prisma from '@/lib/prisma'
11
11
import { ISolved } from '@/types/tasks'
12
- import { getCategory } from '@/utils/getCategoryTree'
12
+ import { generatePath , getCategory } from '@/utils/getCategoryTree'
13
13
14
14
export const metadata : Metadata = {
15
15
title : 'Archive | programming.in.th'
16
16
}
17
17
18
+ export const revalidate = 3600 // 1 hour
19
+
18
20
export default async function Archive ( {
19
21
params
20
22
} : {
@@ -70,9 +72,9 @@ async function generatePaths(slug: string[]) {
70
72
return paths
71
73
}
72
74
73
- // export async function generateStaticParams() {
74
- // const paths = (await generatePath()).map(path => ({
75
- // slug: path
76
- // }))
77
- // return paths
78
- // }
75
+ export async function generateStaticParams ( ) {
76
+ const paths = ( await generatePath ( ) ) . map ( path => ( {
77
+ slug : path
78
+ } ) )
79
+ return paths
80
+ }
You can’t perform that action at this time.
0 commit comments