Skip to content

Commit f6fd164

Browse files
committed
fix other head error
1 parent 37aae6f commit f6fd164

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/overrides/Head.astro

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,13 @@ const shouldChatbotDeprioritize =
3333
// if not a top-level page, add metadata values from src/content/products/ entries
3434
if (currentSection) {
3535
// if entry for product, grab and proceed
36-
console.log(currentSection);
3736
let product = await getEntry("products", currentSection);
3837
// if entry for changelog, grab the first product value (which corresponds to the folder the entry is in) and use as the primary "product"
3938
if (currentSection === "changelog") {
4039
const products = frontmatter.products;
4140
if (products && products.length > 0) {
4241
const primaryProduct = products[0];
43-
product = await getEntry("products", primaryProduct.id);
42+
product = await getEntry("products", primaryProduct);
4443
}
4544
}
4645
@@ -143,9 +142,15 @@ if (frontmatter.pcx_content_type) {
143142
}
144143
145144
if (frontmatter.products) {
145+
const additionalProducts = await Promise.all(
146+
frontmatter.products.map(async (product) => {
147+
const productEntry = await getEntry("products", product.id);
148+
return productEntry?.data?.name || product.id;
149+
}),
150+
);
146151
metaTags.push({
147152
name: "pcx_additional_products",
148-
content: frontmatter.products.toString(),
153+
content: additionalProducts.toString(),
149154
});
150155
}
151156

0 commit comments

Comments
 (0)