fix: drupal-meta — Array.isArray narrowing for custom tags union type
This commit is contained in:
parent
1724a838e2
commit
0dc2a0a570
1 changed files with 16 additions and 14 deletions
|
|
@ -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',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue