mirror of
https://github.com/luxfhe/example-poker.git
synced 2026-10-30 18:13:22 +00:00
35 lines
730 B
TypeScript
35 lines
730 B
TypeScript
import type { Metadata } from "next";
|
|
|
|
export const getMetadata = ({
|
|
title,
|
|
description,
|
|
imageRelativePath = "/thumbnail.jpg",
|
|
}: {
|
|
title: string;
|
|
description: string;
|
|
imageRelativePath?: string;
|
|
}): Metadata => {
|
|
const baseUrl = process.env.VERCEL_URL
|
|
? `https://${process.env.VERCEL_URL}`
|
|
: `http://localhost:${process.env.PORT || 3000}`;
|
|
const imageUrl = `${baseUrl}${imageRelativePath}`;
|
|
return {
|
|
title: title,
|
|
description: description,
|
|
openGraph: {
|
|
title: title,
|
|
description: description,
|
|
images: [
|
|
{
|
|
url: imageUrl,
|
|
},
|
|
],
|
|
},
|
|
twitter: {
|
|
title: title,
|
|
description: description,
|
|
images: [imageUrl],
|
|
},
|
|
};
|
|
};
|