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.
This commit is contained in:
@@ -8,13 +8,19 @@ const generateProductMetaTags = (product, baseUrl, config) => {
|
|||||||
.trim()}.jpg`
|
.trim()}.jpg`
|
||||||
: `${baseUrl}/assets/images/nopicture.jpg`;
|
: `${baseUrl}/assets/images/nopicture.jpg`;
|
||||||
|
|
||||||
|
|
||||||
// Clean description for meta (remove HTML tags and limit length)
|
// Clean description for meta (remove HTML tags and limit length)
|
||||||
const cleanDescription = product.description
|
const cleanDescription = product.kurzBeschreibung
|
||||||
? product.description
|
? product.kurzBeschreibung
|
||||||
.replace(/<[^>]*>/g, "")
|
.replace(/<[^>]*>/g, "")
|
||||||
.replace(/\n/g, " ")
|
.replace(/\n/g, " ")
|
||||||
.substring(0, 160)
|
.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 `
|
return `
|
||||||
<!-- SEO Meta Tags -->
|
<!-- SEO Meta Tags -->
|
||||||
|
|||||||
Reference in New Issue
Block a user