feat(seo): add JSON-LD, OG images and RSS feed for news
This commit is contained in:
+19
-3
@@ -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` },
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user