og
All checks were successful
Build & Deploy KLZ Cables / build-and-deploy (push) Successful in 4m48s

This commit is contained in:
2026-01-29 17:26:02 +01:00
parent 13e56a88bc
commit a2f94f15bc
17 changed files with 102 additions and 36 deletions

24
lib/metadata.ts Normal file
View File

@@ -0,0 +1,24 @@
import { Metadata } from 'next';
import { SITE_URL } from './schema';
export function getOGImageMetadata(path: string, title: string, locale: string): NonNullable<Metadata['openGraph']>['images'] {
return [
{
url: `${SITE_URL}/${locale}/${path}/opengraph-image`,
width: 1200,
height: 630,
alt: title,
},
];
}
export function getProductOGImageMetadata(slug: string, title: string, locale: string): NonNullable<Metadata['openGraph']>['images'] {
return [
{
url: `${SITE_URL}/${locale}/api/og/product?slug=${slug}`,
width: 1200,
height: 630,
alt: title,
},
];
}