Stop statically rendering tags/cameras
This commit is contained in:
parent
e93e23f428
commit
9b772c8858
@ -3,7 +3,6 @@ import SiteGrid from '@/components/SiteGrid';
|
||||
import CameraHeader from '@/camera/CameraHeader';
|
||||
import { getMakeModelFromCameraString } from '@/camera';
|
||||
import PhotoGrid from '@/photo/PhotoGrid';
|
||||
import { getUniqueCameras } from '@/services/postgres';
|
||||
import { Metadata } from 'next';
|
||||
import { generateMetaForCamera } from '@/camera/meta';
|
||||
import { GRID_THUMBNAILS_TO_SHOW_MAX } from '@/photo';
|
||||
@ -13,17 +12,12 @@ import {
|
||||
getPaginationForSearchParams,
|
||||
} from '@/site/pagination';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
interface CameraProps {
|
||||
params: { camera: string },
|
||||
}
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const cameras = await getUniqueCameras();
|
||||
return cameras.map(({ cameraKey }): CameraProps => ({
|
||||
params: { camera: cameraKey },
|
||||
}));
|
||||
}
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: CameraProps): Promise<Metadata> {
|
||||
|
||||
@ -5,7 +5,6 @@ import CameraHeader from '@/camera/CameraHeader';
|
||||
import CameraShareModal from '@/camera/CameraShareModal';
|
||||
import { generateMetaForCamera } from '@/camera/meta';
|
||||
import PhotoGrid from '@/photo/PhotoGrid';
|
||||
import { getUniqueCameras } from '@/services/postgres';
|
||||
import { Metadata } from 'next';
|
||||
import { GRID_THUMBNAILS_TO_SHOW_MAX } from '@/photo';
|
||||
import { pathForCamera } from '@/site/paths';
|
||||
@ -14,17 +13,12 @@ import {
|
||||
getPaginationForSearchParams,
|
||||
} from '@/site/pagination';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
interface CameraProps {
|
||||
params: { camera: string }
|
||||
}
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const camera = await getUniqueCameras();
|
||||
return camera.map(({ cameraKey }): CameraProps => ({
|
||||
params: { camera: cameraKey },
|
||||
}));
|
||||
}
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: CameraProps): Promise<Metadata> {
|
||||
|
||||
@ -2,7 +2,6 @@ import { getPhotosCached, getPhotosCountTagCached } from '@/cache';
|
||||
import SiteGrid from '@/components/SiteGrid';
|
||||
import { GRID_THUMBNAILS_TO_SHOW_MAX } from '@/photo';
|
||||
import PhotoGrid from '@/photo/PhotoGrid';
|
||||
import { getUniqueTags } from '@/services/postgres';
|
||||
import {
|
||||
PaginationParams,
|
||||
getPaginationForSearchParams,
|
||||
@ -12,17 +11,12 @@ import { generateMetaForTag } from '@/tag';
|
||||
import TagHeader from '@/tag/TagHeader';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
interface TagProps {
|
||||
params: { tag: string }
|
||||
}
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const tags = await getUniqueTags();
|
||||
return tags.map(tag => ({
|
||||
params: { tag },
|
||||
}));
|
||||
}
|
||||
|
||||
export async function generateMetadata({
|
||||
params: { tag },
|
||||
}: TagProps): Promise<Metadata> {
|
||||
|
||||
@ -2,7 +2,6 @@ import { getPhotosCached, getPhotosCountTagCached } from '@/cache';
|
||||
import SiteGrid from '@/components/SiteGrid';
|
||||
import { GRID_THUMBNAILS_TO_SHOW_MAX } from '@/photo';
|
||||
import PhotoGrid from '@/photo/PhotoGrid';
|
||||
import { getUniqueTags } from '@/services/postgres';
|
||||
import {
|
||||
PaginationParams,
|
||||
getPaginationForSearchParams,
|
||||
@ -13,17 +12,12 @@ import TagHeader from '@/tag/TagHeader';
|
||||
import TagShareModal from '@/tag/TagShareModal';
|
||||
import { Metadata } from 'next';
|
||||
|
||||
export const runtime = 'edge';
|
||||
|
||||
interface TagProps {
|
||||
params: { tag: string }
|
||||
}
|
||||
|
||||
export async function generateStaticParams() {
|
||||
const tags = await getUniqueTags();
|
||||
return tags.map(tag => ({
|
||||
params: { tag },
|
||||
}));
|
||||
}
|
||||
|
||||
export async function generateMetadata({
|
||||
params: { tag },
|
||||
}: TagProps): Promise<Metadata> {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user