Skip to content

Commit 94e77e1

Browse files
committed
chore: restore names in og
1 parent 2025d0f commit 94e77e1

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

app/components/OgImage/BlogPost.vue

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ const formattedDate = computed(() => {
3535
3636
const MAX_VISIBLE_AUTHORS = 2
3737
38+
const getInitials = (name: string) =>
39+
name
40+
.split(' ')
41+
.map(n => n[0])
42+
.join('')
43+
.toUpperCase()
44+
.slice(0, 2)
45+
46+
const visibleAuthors = computed(() => {
47+
console.log('blog post 5', props.authors)
48+
if (props.authors.length <= 3) return props.authors
49+
return props.authors.slice(0, MAX_VISIBLE_AUTHORS)
50+
})
51+
3852
const extraCount = computed(() => {
3953
console.log('blog post 6', props.authors)
4054
if (props.authors.length <= 3) return 0
@@ -94,6 +108,22 @@ const formattedAuthorNames = computed(() => {
94108
>
95109
<!-- Stacked avatars -->
96110
<span>
111+
<span
112+
v-for="(author, index) in visibleAuthors"
113+
:key="author.name"
114+
class="flex items-center justify-center rounded-full border border-[#050505] bg-[#1a1a1a] overflow-hidden w-12 h-12"
115+
:style="{ marginLeft: index > 0 ? '-20px' : '0' }"
116+
>
117+
<img
118+
v-if="author.avatar"
119+
:src="author.avatar"
120+
:alt="author.name"
121+
class="w-full h-full object-cover"
122+
/>
123+
<span v-else style="font-size: 20px; color: #666; font-weight: 500">
124+
{{ getInitials(author.name) }}
125+
</span>
126+
</span>
97127
<!-- +N badge -->
98128
<span
99129
v-if="extraCount > 0"

0 commit comments

Comments
 (0)