diff --git a/cigaradvisor/blocks/article-teaser/article-teaser.js b/cigaradvisor/blocks/article-teaser/article-teaser.js index dc5100a..f06e7b5 100644 --- a/cigaradvisor/blocks/article-teaser/article-teaser.js +++ b/cigaradvisor/blocks/article-teaser/article-teaser.js @@ -5,6 +5,7 @@ import { // eslint-disable-next-line max-len export function buildArticleTeaser(parentElement, article) { + const author = article.author || {}; const ldjson = { '@context': 'http://schema.org', '@type': 'BlogPosting', @@ -23,8 +24,8 @@ export function buildArticleTeaser(parentElement, article) { dateModified: new Date(article.lastModified * 1000).toISOString(), author: { '@type': 'Person', - name: article.author.name, - url: `https://www.famous-smoke.com${article.author.path}`, + name: author.name || 'Unknown', + url: `https://www.famous-smoke.com${author.path || '/author'}`, }, image: `https://www.famous-smoke.com${article.image}`, }; @@ -47,7 +48,7 @@ export function buildArticleTeaser(parentElement, article) { ${article.heading}