We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5654d75 commit a304278Copy full SHA for a304278
app/pages/[slug]/page.tsx
@@ -1,8 +1,20 @@
1
-import { getPageBySlug } from "@/lib/wordpress";
+import { getPageBySlug, getAllPages } from "@/lib/wordpress";
2
import { Section, Container, Prose } from "@/components/craft";
3
-import { Metadata } from "next";
4
import { siteConfig } from "@/site.config";
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
18
export async function generateMetadata({
19
params,
20
}: {
0 commit comments