fix: undefined while reading author data
This commit is contained in:
parent
cc238f8f2a
commit
4387aa1f6a
1 changed files with 1 additions and 1 deletions
|
@ -26,7 +26,7 @@ const slug = Astro.params.slug;
|
|||
const author = Array.isArray(entry.data.author) ? entry.data.author : (entry.data.author !== undefined ? [entry.data.author] : [{collection: 'authors', id: siteConfig.defaultAuthor.id}]);
|
||||
|
||||
// Get author data
|
||||
const authorData = await Promise.all((author).map((singleAuthor) => getEntry(singleAuthor).then(authorEntry => authorEntry.data)))
|
||||
const authorData = await Promise.all((author).map((singleAuthor) => getEntry(singleAuthor).then(authorEntry => authorEntry?.data)))
|
||||
const authorInfo = authorData.includes(undefined) ? [{data: siteConfig.defaultAuthor}] : authorData;
|
||||
|
||||
// get featured image and use it as og:image
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue