diff --git a/src/lib/components/Article.svelte b/src/lib/components/Article.svelte index 261dd661f9..b381305e20 100644 --- a/src/lib/components/Article.svelte +++ b/src/lib/components/Article.svelte @@ -2,50 +2,64 @@ import Media from '$lib/UI/Media.svelte'; import { formatDate } from '$lib/utils/date'; + import type { AuthorInfo } from '$lib/utils/blog-authors'; + interface ArticleProps { title: string; cover: string; href: string; date: Date; timeToRead: number; - author: string; - avatar: string; + authors: AuthorInfo[]; + avatars: string[]; } - const { title, cover, href, date, timeToRead, author, avatar }: ArticleProps = $props(); + const { title, cover, href, date, timeToRead, authors, avatars }: ArticleProps = $props(); + + const authorAvatarPairs = $derived( + avatars.map((avatar, i) => ({ avatar, author: authors[i] })).filter(({ avatar }) => avatar) + );