From f1c30b71417e524ee18cf8a0734fe03a32878742 Mon Sep 17 00:00:00 2001 From: Unchained Date: Mon, 30 Mar 2026 13:07:40 +0200 Subject: [PATCH] fix: replace {{productName}} template in product page keywords - Add template replacement logic for product keywords - Replace {{productName}} with actual product.name - Keywords now show correct product name instead of template variable --- src/app/[locale]/products/[slug]/page.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app/[locale]/products/[slug]/page.tsx b/src/app/[locale]/products/[slug]/page.tsx index e973a3c..d51e5a0 100644 --- a/src/app/[locale]/products/[slug]/page.tsx +++ b/src/app/[locale]/products/[slug]/page.tsx @@ -51,6 +51,11 @@ export async function generateMetadata({ params }: ProductPageProps): Promise str.replace(/\{\{productName\}\}/g, product.name); + const primaryKeywords = keywords.primary.map(replaceTemplate); + const secondaryKeywords = keywords.secondary.map(replaceTemplate); + // Build canonical URL const localePrefix = validLocale === DEFAULT_LOCALE ? "" : `/${validLocale}`; const canonicalUrl = `${baseUrl}${localePrefix}/products/${slug}`; @@ -61,7 +66,7 @@ export async function generateMetadata({ params }: ProductPageProps): Promise