Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 14s
Build & Deploy / 🧪 QA (push) Successful in 1m40s
Build & Deploy / 🏗️ Build (push) Successful in 3m59s
Build & Deploy / 🚀 Deploy (push) Successful in 30s
Build & Deploy / 🧪 Smoke Test (push) Failing after 52s
Build & Deploy / 🔔 Notify (push) Successful in 2s
23 lines
735 B
TypeScript
23 lines
735 B
TypeScript
import { ImageResponse } from 'next/og';
|
|
import { getTranslations } from 'next-intl/server';
|
|
import { OGImageTemplate } from '@/components/OGImageTemplate';
|
|
import { getOgFonts, OG_IMAGE_SIZE } from '@/lib/og-helper';
|
|
|
|
export const size = OG_IMAGE_SIZE;
|
|
export const contentType = 'image/png';
|
|
export const runtime = 'nodejs';
|
|
|
|
export default async function Image({ params }: { params: Promise<{ locale: string }> }) {
|
|
const { locale } = await params;
|
|
const t = await getTranslations({ locale, namespace: 'Blog.meta' });
|
|
const fonts = await getOgFonts();
|
|
|
|
return new ImageResponse(
|
|
<OGImageTemplate title={t('title')} description={t('description')} label="Blog" />,
|
|
{
|
|
...OG_IMAGE_SIZE,
|
|
fonts,
|
|
},
|
|
);
|
|
}
|