@@ -33,12 +33,14 @@ const shouldChatbotDeprioritize =
3333// if not a top-level page, add metadata values from src/content/products/ entries
3434if (currentSection ) {
3535 // if entry for product, grab and proceed
36+ console .log (currentSection );
3637 let product = await getEntry (" products" , currentSection );
3738 // if entry for changelog, grab the first product value (which corresponds to the folder the entry is in) and use as the primary "product"
3839 if (currentSection === " changelog" ) {
3940 const products = frontmatter .products ;
40- if (products ) {
41- product = await getEntry (" products" , products [0 ]);
41+ if (products && products .length > 0 ) {
42+ const primaryProduct = products [0 ];
43+ product = await getEntry (" products" , primaryProduct .id );
4244 }
4345 }
4446
@@ -112,11 +114,11 @@ if (shouldChatbotDeprioritize) {
112114if (
113115 frontmatter .description &&
114116 head .findIndex (
115- ({ tag , attrs }) => tag === " meta" && attrs ?.name === " description"
117+ ({ tag , attrs }) => tag === " meta" && attrs ?.name === " description" ,
116118 ) === - 1
117119) {
118120 const existingOpenGraphTag = head .findIndex (
119- ({ tag , attrs }) => tag === " meta" && attrs ?.property === " og:description"
121+ ({ tag , attrs }) => tag === " meta" && attrs ?.property === " og:description" ,
120122 );
121123
122124 if (existingOpenGraphTag !== - 1 ) {
@@ -166,7 +168,7 @@ if (lastUpdated) {
166168if (frontmatter .reviewed ) {
167169 const daysBetween = differenceInCalendarDays (
168170 new Date (),
169- frontmatter .reviewed
171+ frontmatter .reviewed ,
170172 );
171173
172174 metaTags .push ({
@@ -197,7 +199,7 @@ if (frontmatter.pcx_content_type === "changelog") {
197199
198200const ogImagePath = await getOgImage (
199201 (Astro .locals .starlightRoute .originalEntry as CollectionEntry <" changelog" >) ??
200- Astro .locals .starlightRoute .entry
202+ Astro .locals .starlightRoute .entry ,
201203);
202204const ogImageUrl = new URL (ogImagePath , Astro .url .origin ).toString ();
203205
0 commit comments