Fix and issue when authorDetails
prop is empty
This commit is contained in:
parent
e92b7d2737
commit
331461be12
@ -42,12 +42,20 @@ export const BlogSeo = ({ authorDetails, title, summary, date, lastmod, url, ima
|
||||
}
|
||||
})
|
||||
|
||||
const authorList = authorDetails.map((author) => {
|
||||
return {
|
||||
let authorList
|
||||
if (authorDetails) {
|
||||
authorList = authorDetails.map((author) => {
|
||||
return {
|
||||
'@type': 'Person',
|
||||
name: author.name,
|
||||
}
|
||||
})
|
||||
} else {
|
||||
authorList = {
|
||||
'@type': 'Person',
|
||||
name: author.name,
|
||||
name: siteMetadata.author,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const structuredData = {
|
||||
'@context': 'https://schema.org',
|
||||
|
Loading…
x
Reference in New Issue
Block a user