fix: og image generation
This commit is contained in:
@@ -1,9 +1,23 @@
|
||||
export const dynamic = "force-dynamic";
|
||||
|
||||
import type { Metadata } from "next";
|
||||
import { notFound } from "next/navigation";
|
||||
import { getLettersByLocation } from "@/lib/letters";
|
||||
import { ogForLettersByLocation } from "@/lib/og";
|
||||
import { FilterYearBrowser } from "../../filter-year-browser";
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<{ name: string }>;
|
||||
}): Promise<Metadata> {
|
||||
const { name: encodedName } = await params;
|
||||
const name = decodeURIComponent(encodedName);
|
||||
const letters = await getLettersByLocation(name);
|
||||
if (letters.length === 0) return {};
|
||||
return ogForLettersByLocation(name, letters.length);
|
||||
}
|
||||
|
||||
export default async function LettersByLocationPage({
|
||||
params,
|
||||
}: {
|
||||
|
||||
Reference in New Issue
Block a user