Generate static tag params
This commit is contained in:
parent
c7fdfd1df2
commit
682d331141
@ -1,6 +1,7 @@
|
|||||||
import { getPhotosCached } from '@/cache';
|
import { getPhotosCached } from '@/cache';
|
||||||
import SiteGrid from '@/components/SiteGrid';
|
import SiteGrid from '@/components/SiteGrid';
|
||||||
import PhotoGrid from '@/photo/PhotoGrid';
|
import PhotoGrid from '@/photo/PhotoGrid';
|
||||||
|
import { getUniqueTags } from '@/services/postgres';
|
||||||
import { absolutePathForTag, absolutePathForTagImage } from '@/site/paths';
|
import { absolutePathForTag, absolutePathForTagImage } from '@/site/paths';
|
||||||
import { descriptionForTaggedPhotos, titleForTag } from '@/tag';
|
import { descriptionForTaggedPhotos, titleForTag } from '@/tag';
|
||||||
import TagHeader from '@/tag/TagHeader';
|
import TagHeader from '@/tag/TagHeader';
|
||||||
@ -10,6 +11,13 @@ interface TagProps {
|
|||||||
params: { tag: string }
|
params: { tag: string }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function generateStaticParams() {
|
||||||
|
const tags = await getUniqueTags();
|
||||||
|
return tags.map(tag => ({
|
||||||
|
params: { tag },
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
export async function generateMetadata({
|
export async function generateMetadata({
|
||||||
params: { tag },
|
params: { tag },
|
||||||
}: TagProps): Promise<Metadata> {
|
}: TagProps): Promise<Metadata> {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user