feat: add SEO metadata and Open Graph helpers
Some checks failed
Deploy / deploy (push) Has been cancelled

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
consultoria-as
2026-02-22 04:12:16 +00:00
parent 8e9f45b38b
commit a167c6643b
2 changed files with 40 additions and 1 deletions

View File

@@ -8,8 +8,12 @@ import { Footer } from "@/components/layout/Footer";
import "./globals.css";
export const metadata: Metadata = {
title: "Project Afterlife",
title: {
default: "Project Afterlife",
template: "%s | Project Afterlife",
},
description: "Preserving online games that deserve a second life",
metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL || "https://projectafterlife.dev"),
};
export default async function LocaleLayout({

View File

@@ -0,0 +1,35 @@
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] : [],
},
};
}