From 1d469620ba2b7fd80b90799fc522a3a5f6e0201c Mon Sep 17 00:00:00 2001 From: Hippo Date: Sun, 26 Apr 2020 22:35:43 +0530 Subject: [PATCH] Bugfix: build fails if post has no authors Because it tries to count the first one anyway --- src/templates/GhostPost.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/templates/GhostPost.vue b/src/templates/GhostPost.vue index c99b7d8..a82d393 100644 --- a/src/templates/GhostPost.vue +++ b/src/templates/GhostPost.vue @@ -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(',') : '' }, ])