Some checks failed
Deploy / deploy (push) Has been cancelled
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
36 lines
736 B
TypeScript
36 lines
736 B
TypeScript
import type { Metadata } from "next";
|
|
|
|
const BASE_URL = process.env.NEXT_PUBLIC_SITE_URL || "https://projectafterlife.dev";
|
|
|
|
export function createMetadata({
|
|
title,
|
|
description,
|
|
image,
|
|
path = "",
|
|
}: {
|
|
title: string;
|
|
description: string;
|
|
image?: string;
|
|
path?: string;
|
|
}): Metadata {
|
|
const url = `${BASE_URL}${path}`;
|
|
return {
|
|
title: `${title} | Project Afterlife`,
|
|
description,
|
|
openGraph: {
|
|
title,
|
|
description,
|
|
url,
|
|
siteName: "Project Afterlife",
|
|
images: image ? [{ url: image, width: 1200, height: 630 }] : [],
|
|
type: "website",
|
|
},
|
|
twitter: {
|
|
card: "summary_large_image",
|
|
title,
|
|
description,
|
|
images: image ? [image] : [],
|
|
},
|
|
};
|
|
}
|