feat: Add generateCategoryMetaTags function for enhanced SEO in category pages and integrate it into prerender process
This commit is contained in:
@@ -125,6 +125,7 @@ const {
|
||||
const {
|
||||
generateProductMetaTags,
|
||||
generateProductJsonLd,
|
||||
generateCategoryMetaTags,
|
||||
generateCategoryJsonLd,
|
||||
generateHomepageMetaTags,
|
||||
generateHomepageJsonLd,
|
||||
@@ -621,19 +622,25 @@ const renderApp = async (categoryData, socket) => {
|
||||
const filename = `Kategorie/${category.seoName}`;
|
||||
const location = `/Kategorie/${category.seoName}`;
|
||||
const description = `Category "${category.name}" (ID: ${category.id})`;
|
||||
const categoryMetaTags = generateCategoryMetaTags(
|
||||
category,
|
||||
shopConfig.baseUrl,
|
||||
shopConfig
|
||||
);
|
||||
const categoryJsonLd = generateCategoryJsonLd(
|
||||
category,
|
||||
productData?.products || [],
|
||||
shopConfig.baseUrl,
|
||||
shopConfig
|
||||
);
|
||||
const combinedCategoryHead = categoryMetaTags + "\n" + categoryJsonLd;
|
||||
|
||||
const success = render(
|
||||
categoryComponent,
|
||||
location,
|
||||
filename,
|
||||
description,
|
||||
categoryJsonLd,
|
||||
combinedCategoryHead,
|
||||
true
|
||||
);
|
||||
if (success) {
|
||||
|
||||
Reference in New Issue
Block a user