From bccaf703effda2a5801d4c7530c03a1adade6098 Mon Sep 17 00:00:00 2001 From: sebseb7 Date: Mon, 8 Sep 2025 05:26:03 +0200 Subject: [PATCH] feat(seo): prioritize short description for product meta tags Now uses `kurzBeschreibung` for SEO meta description if available, falling back to full `description` or name/article number otherwise. This improves relevance and conciseness of meta tags. --- prerender/seo/product.cjs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/prerender/seo/product.cjs b/prerender/seo/product.cjs index 7b2a184..2e88dc9 100644 --- a/prerender/seo/product.cjs +++ b/prerender/seo/product.cjs @@ -8,13 +8,19 @@ const generateProductMetaTags = (product, baseUrl, config) => { .trim()}.jpg` : `${baseUrl}/assets/images/nopicture.jpg`; + // Clean description for meta (remove HTML tags and limit length) - const cleanDescription = product.description - ? product.description + const cleanDescription = product.kurzBeschreibung + ? product.kurzBeschreibung .replace(/<[^>]*>/g, "") .replace(/\n/g, " ") .substring(0, 160) - : `${product.name} - Art.-Nr.: ${product.articleNumber}`; + : product.description + ? product.description + .replace(/<[^>]*>/g, "") + .replace(/\n/g, " ") + .substring(0, 160) + : `${product.name} - Art.-Nr.: ${product.articleNumber}`; return `