diff --git a/pages/about/news/_slug.vue b/pages/about/news/_slug.vue index 6c3b20099..e3ff0fe52 100644 --- a/pages/about/news/_slug.vue +++ b/pages/about/news/_slug.vue @@ -12,7 +12,7 @@ :category="parsedCategory" :title="page.title" :text="page.text" - :byline="parsedBylineBannerText" + :byline="parsedByline" :locations="parsedLocations" :date-created="page.postDate" /> @@ -102,24 +102,14 @@ export default { }, computed: { parsedByline() { - let byline = (this.page.contributors || []).map((entry) => { - return `${entry.byline || ""} ${ - entry.title || entry.staffMember[0].title - }` + let byline = (this.page.contributors || []).map((contributor) => { + if ((contributor.staffMember && contributor.staffMember.length > 0) || contributor.title) + return `${contributor.byline || ""} ${ contributor.title || contributor.staffMember[0].title}` }) - return byline.map((entry) => { - return entry + return byline.map((contributor) => { + return contributor }) }, - - parsedBylineBannerText() { - return (this.page.contributors || []).map((entry) => { - return `${entry.byline} ${ - entry.title || entry.staffMember[0].title - }` - }) - }, - parsedDate() { return format(new Date(this.page.postDate), "MMMM d, Y") }, @@ -151,30 +141,8 @@ export default {