Skip to content

Commit a304278

Browse files
committed
feat: add ssg to pages
1 parent 5654d75 commit a304278

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

app/pages/[slug]/page.tsx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
1-
import { getPageBySlug } from "@/lib/wordpress";
1+
import { getPageBySlug, getAllPages } from "@/lib/wordpress";
22
import { Section, Container, Prose } from "@/components/craft";
3-
import { Metadata } from "next";
43
import { siteConfig } from "@/site.config";
54

5+
import type { Metadata } from "next";
6+
7+
// Revalidate pages every hour
8+
export const revalidate = 3600;
9+
10+
export async function generateStaticParams() {
11+
const pages = await getAllPages();
12+
13+
return pages.map((page) => ({
14+
slug: page.slug,
15+
}));
16+
}
17+
618
export async function generateMetadata({
719
params,
820
}: {

0 commit comments

Comments
 (0)