From 1301a773881195233d3eea1f7ee05bebbcf154db Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Wed, 28 Feb 2024 11:58:48 -0600 Subject: [PATCH] Statically generate individual photo pages --- src/app/p/[photoId]/layout.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/p/[photoId]/layout.tsx b/src/app/p/[photoId]/layout.tsx index 76b4a524..04798d2c 100644 --- a/src/app/p/[photoId]/layout.tsx +++ b/src/app/p/[photoId]/layout.tsx @@ -16,10 +16,13 @@ import { getPhotosNearIdCached } from '@/photo/cache'; import { getPhotoIds } from '@/services/vercel-postgres'; import { STATICALLY_OPTIMIZED } from '@/site/config'; +export let revalidate: number | undefined; + export let generateStaticParams: - (() => Promise<{ params: { photoId: string } }[]>) | undefined = undefined; + (() => Promise<{ params: { photoId: string } }[]>) | undefined; if (STATICALLY_OPTIMIZED) { + revalidate = 3600; generateStaticParams = async () => { const photos = await getPhotoIds({ limit: GENERATE_STATIC_PARAMS_LIMIT }); return photos.map(photoId => ({