Statically generate photo pages

This commit is contained in:
Sam Becker 2023-09-20 21:33:59 -05:00
parent 97bc58bd8a
commit 62f5a1ec7f

View File

@ -8,8 +8,14 @@ import { redirect } from 'next/navigation';
import { absolutePathForPhoto, absolutePathForPhotoImage } from '@/site/paths';
import PhotoDetailPage from '@/photo/PhotoDetailPage';
import { getPhotoCached, getPhotosCached } from '@/cache';
import { getPhotos } from '@/services/postgres';
export const runtime = 'edge';
export async function generateStaticParams() {
const photos = await getPhotos();
return photos.map(photo => ({
slug: photo.id,
}));
}
export async function generateMetadata({
params: { photoId },