Reintroduce generateStaticParams

This commit is contained in:
Sam Becker 2024-01-27 14:36:25 -06:00
parent 900d21b5a4
commit fae1dcb81f

View File

@ -1,4 +1,5 @@
import {
GENERATE_STATIC_PARAMS_LIMIT,
GRID_THUMBNAILS_TO_SHOW_MAX,
descriptionForPhoto,
titleForPhoto,
@ -12,6 +13,14 @@ import {
} from '@/site/paths';
import PhotoDetailPage from '@/photo/PhotoDetailPage';
import { getPhotosNearIdCached } from '@/cache';
import { getPhotoIds } from '@/services/vercel-postgres';
export async function generateStaticParams() {
const photos = await getPhotoIds({ limit: GENERATE_STATIC_PARAMS_LIMIT });
return photos.map(photoId => ({
params: { photoId },
}));
}
interface PhotoProps {
params: { photoId: string }