Spaces:
Running
Running
metadata
Browse files- app/[roastId]/page.tsx +26 -0
app/[roastId]/page.tsx
CHANGED
@@ -5,12 +5,38 @@ import { getRoast } from "@/app/actions/roast";
|
|
5 |
import { Quote } from "@/components/quote";
|
6 |
import Logo from "@/assets/logo.svg";
|
7 |
import Link from "next/link";
|
|
|
8 |
|
9 |
async function get(id: string) {
|
10 |
const roast = await getRoast({ id });
|
11 |
return roast;
|
12 |
}
|
13 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
export default async function Roast({
|
15 |
params: { roastId },
|
16 |
}: {
|
|
|
5 |
import { Quote } from "@/components/quote";
|
6 |
import Logo from "@/assets/logo.svg";
|
7 |
import Link from "next/link";
|
8 |
+
import { Metadata, ResolvingMetadata } from "next";
|
9 |
|
10 |
async function get(id: string) {
|
11 |
const roast = await getRoast({ id });
|
12 |
return roast;
|
13 |
}
|
14 |
|
15 |
+
export async function generateMetadata(
|
16 |
+
{ params }: { params: { roastId: string } },
|
17 |
+
parent: ResolvingMetadata
|
18 |
+
): Promise<Metadata> {
|
19 |
+
return {
|
20 |
+
title: "Hugger Roaster",
|
21 |
+
description: "A Hugger has been roasted! 🔥 Check it out",
|
22 |
+
metadataBase: new URL("https://enzostvs-hugger-roaster.hf.space"),
|
23 |
+
openGraph: {
|
24 |
+
title: "Hugger Roaster",
|
25 |
+
description: "A Hugger has been roasted! 🔥 Check it out",
|
26 |
+
type: "website",
|
27 |
+
images:
|
28 |
+
"https://enzostvs-hugger-roaster.hf.space/api/og/" + params.roastId,
|
29 |
+
},
|
30 |
+
twitter: {
|
31 |
+
title: "Hugger Roaster",
|
32 |
+
description: "A Hugger has been roasted! 🔥 Check it out",
|
33 |
+
card: "summary_large_image",
|
34 |
+
images:
|
35 |
+
"https://enzostvs-hugger-roaster.hf.space/api/og/" + params.roastId,
|
36 |
+
},
|
37 |
+
};
|
38 |
+
}
|
39 |
+
|
40 |
export default async function Roast({
|
41 |
params: { roastId },
|
42 |
}: {
|