This commit is contained in:
Your Name committed 2026-09-29 13:46:02 +07:00
1 parent e87176dba3
commit 80e715da76
3 files changed
+59 -8

No files matched your search

+4 -3
View File
@@ -12,20 +12,21 @@ import type { CSSProperties } from 'react';
export async function generateMetadata({ params }: { params: Promise<{ lang: string }> }): Promise<Metadata> {
const { lang } = await params;
const settings = await getStoreSettings(lang);
const brandName = settings?.brandName || '';
const brandName = settings?.brandName || 'HomAroma';
const defaultTitle = settings?.defaultSeoTitle || brandName;
const description = settings?.defaultSeoDescription || settings?.footerDescription || 'Pure Origins, Artisan Craft, Zero Compromise';
const ogImage = settings?.defaultOgImage;
return {
title: {
template: `%s | ${brandName}`,
default: brandName,
default: defaultTitle,
},
description,
metadataBase: new URL(process.env.NEXT_PUBLIC_SITE_URL || 'http://localhost:3000'),
openGraph: ogImage
? {
title: brandName,
title: defaultTitle,
description,
images: [ogImage],
}
+3 -2
View File
@@ -15,10 +15,11 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
getStoreSettings(lang),
])
const title = page?.seoTitle || page?.title || undefined
const title = page?.seoTitle || settings?.defaultSeoTitle || (page?.title && page.title !== 'Home' && page.title !== 'หน้าแรก' ? page.title : undefined) || settings?.brandName || undefined
const description =
page?.seoDescription ||
settings?.defaultSeoDescription ||
settings?.footerDescription ||
(settings?.brandName ? `${settings.brandName} - Pure Origins, Artisan Craft` : 'Pure Origins, Artisan Craft')
const ogImage = page?.ogImageUrl || settings?.defaultOgImage
@@ -29,7 +30,7 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
lang,
openGraph: ogImage
? {
title: page?.seoTitle || page?.title || settings?.brandName || undefined,
title,
description,
images: [ogImage],
}