Add the Kaman Cable Next.js storefront with Meshkee catalog, blog, auth, and static-image slots.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
import type { Metadata } from "next";
|
||||
|
||||
import { site } from "@/data/site";
|
||||
import { websiteDomain } from "@/lib/config";
|
||||
|
||||
export const siteUrl = `https://${websiteDomain}`;
|
||||
|
||||
export function pageMetadata({
|
||||
title,
|
||||
description,
|
||||
path = "/",
|
||||
image,
|
||||
absolute = false,
|
||||
}: {
|
||||
title: string;
|
||||
description: string;
|
||||
path?: string;
|
||||
image?: string | null;
|
||||
absolute?: boolean;
|
||||
}): Metadata {
|
||||
const url = `${siteUrl}${path.startsWith("/") ? path : `/${path}`}`;
|
||||
const ogImage = image || `${siteUrl}/images/slider/bg1.jpg`;
|
||||
|
||||
return {
|
||||
title: absolute ? { absolute: title } : title,
|
||||
description,
|
||||
alternates: { canonical: url },
|
||||
openGraph: {
|
||||
type: path === "/" ? "website" : "article",
|
||||
locale: "fa_IR",
|
||||
url,
|
||||
siteName: site.shortName,
|
||||
title,
|
||||
description,
|
||||
images: [{ url: ogImage, alt: title }],
|
||||
},
|
||||
twitter: {
|
||||
card: "summary_large_image",
|
||||
title,
|
||||
description,
|
||||
images: [ogImage],
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user