From 7d9871b1f0b4586531f5b2c14fab7f53baf63aed Mon Sep 17 00:00:00 2001 From: jendiamond Date: Tue, 15 Aug 2023 19:20:52 -0700 Subject: [PATCH] update parsedByline --- pages/about/news/_slug.vue | 50 +++++++------------------------------- 1 file changed, 9 insertions(+), 41 deletions(-) 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 {