Bugfix: build fails if post has no authors

Because it tries to count the first one anyway
This commit is contained in:
Hippo 2020-04-26 22:35:43 +05:30
parent 15905289e1
commit 1d469620ba

View file

@ -116,7 +116,7 @@ export default {
{ property: 'twitter:url', content: baseUrl + this.thisPost.path },
{ property: 'twitter:image', content: changeUrls(this.thisPost.image) },
{ property: 'twitter:label1', content: 'Written by' },
{ property: 'twitter:data1', content: this.thisPost.authors[0].name },
{ property: 'twitter:data1', content: this.thisPost.authors ? this.thisPost.authors[0].name : '' },
{ property: 'twitter:label2', content: 'Filed under' },
{ property: 'twitter:data2', content: this.thisPost.tags ? this.thisPost.tags.map((t)=>{return t.title}).join(',') : '' },
])