feat(seo): add JSON-LD, OG images and RSS feed for news

This commit is contained in:
openhands
2026-10-22 18:22:32 +02:00
parent 97454f361b
commit 30583b8e2e
7 changed files with 328 additions and 11 deletions
+19 -3
View File
@@ -38,7 +38,10 @@ const pixelify = Pixelify_Sans({
// export const instant = false;
export async function generateMetadata(): Promise<Metadata> {
const appUrl = process.env.APP_URL ?? "http://localhost:3000";
const appUrl = (process.env.APP_URL ?? "http://localhost:3000").replace(
/\/+$/,
"",
);
const hotel = await resolveHotelName();
const customFavicon = await siteSettings.get("cms_favicon");
const faviconUrl = customFavicon ?? getDefaultFaviconDataUri();
@@ -50,15 +53,28 @@ export async function generateMetadata(): Promise<Metadata> {
title: { default: `${hotel} - Hotel`, template: `%s · ${hotel}` },
description: `${hotel} — a Habbo retro hotel. Hang out, collect furni and meet friends.`,
metadataBase: new URL(appUrl),
alternates: { canonical: appUrl },
alternates: {
canonical: appUrl,
types: { "application/rss+xml": `${appUrl}/news/rss.xml` },
},
icons,
openGraph: {
title: `${hotel} - Hotel`,
description: `${hotel} — a Habbo retro hotel. Hang out, collect furni and meet friends.`,
type: "website",
siteName: hotel,
images: [
{
url: `${appUrl}/assets/images/next_header.jpg`,
alt: `${hotel} - Hotel`,
},
],
},
twitter: {
card: "summary_large_image",
title: `${hotel} - Hotel`,
images: [`${appUrl}/assets/images/next_header.jpg`],
},
twitter: { card: "summary_large_image", title: `${hotel} - Hotel` },
};
}