diff --git a/apps/vdn-static/src/utils/drupal-meta.ts b/apps/vdn-static/src/utils/drupal-meta.ts index 9078f38..1475417 100644 --- a/apps/vdn-static/src/utils/drupal-meta.ts +++ b/apps/vdn-static/src/utils/drupal-meta.ts @@ -60,19 +60,21 @@ export function generateDrupalNodeMeta( } // Add sticky/promote as robots meta - if (attributes.sticky || attributes.promote) { - meta.custom?.push({ - name: 'robots', - content: 'index, follow', - }) - } + if (meta.custom && Array.isArray(meta.custom)) { + if (attributes.sticky || attributes.promote) { + meta.custom.push({ + name: 'robots', + content: 'index, follow', + }) + } - // Add status-based robots meta - if (!attributes.status) { - meta.custom?.push({ - name: 'robots', - content: 'noindex, nofollow', - }) + // Add status-based robots meta + if (!attributes.status) { + meta.custom.push({ + name: 'robots', + content: 'noindex, nofollow', + }) + } } return meta @@ -98,7 +100,7 @@ export function generateArticleContentMeta( type: 'article', }, custom: [ - ...(baseMeta.custom || []), + ...(Array.isArray(baseMeta.custom) ? baseMeta.custom : []), // Article-specific meta tags { property: 'article:section', @@ -151,7 +153,7 @@ export function generateLearningResourceMeta( type: 'article', }, custom: [ - ...(baseMeta.custom || []), + ...(Array.isArray(baseMeta.custom) ? baseMeta.custom : []), // Learning resource-specific meta tags { name: 'resource-type',