Statically generate grid, [photoId] paths
This commit is contained in:
parent
590821e3dc
commit
57c137cee6
@ -8,7 +8,8 @@ import { getPhotos, getPhotosCount, getUniqueTags } from '@/services/postgres';
|
||||
import PhotoTag from '@/tag/PhotoTag';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export const runtime = 'edge';
|
||||
// Revalidate every 12 hours
|
||||
export const revalidate = 43_200;
|
||||
|
||||
export async function generateMetadata(): Promise<Metadata> {
|
||||
const photos = await getPhotos();
|
||||
|
||||
@ -6,6 +6,7 @@ import {
|
||||
import { Metadata } from 'next';
|
||||
import {
|
||||
getPhoto,
|
||||
getPhotos,
|
||||
getPhotosTakenAfterPhotoInclusive,
|
||||
getPhotosTakenBeforePhoto,
|
||||
} from '@/services/postgres';
|
||||
@ -13,7 +14,15 @@ import { redirect } from 'next/navigation';
|
||||
import { absolutePathForPhoto, absolutePathForPhotoImage } from '@/site/paths';
|
||||
import PhotoDetailPage from '@/photo/PhotoDetailPage';
|
||||
|
||||
export const runtime = 'edge';
|
||||
// Revalidate every 12 hours
|
||||
export const revalidate = 43_200;
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const photos = await getPhotos();
|
||||
return photos.map(photo => ({
|
||||
slug: photo.id,
|
||||
}));
|
||||
}
|
||||
|
||||
export async function generateMetadata({
|
||||
params: { photoId },
|
||||
|
||||
Loading…
Reference in New Issue
Block a user