feat: polishing

This commit is contained in:
enscribe 2024-09-12 13:03:09 -07:00
parent 77bf1bbdf4
commit 0b430e5d43
No known key found for this signature in database
GPG key ID: 9BBD5C4114E25322
21 changed files with 235 additions and 144 deletions

View file

@ -32,12 +32,7 @@ const { author } = Astro.props
const allPosts = await getCollection('blog')
const authorPosts = allPosts
.filter((post) => {
if (typeof post.data.author === 'string') {
return post.data.author === author.data.name && !post.data.draft
} else if (post.data.author && 'slug' in post.data.author) {
return post.data.author.slug === author.slug && !post.data.draft
}
return false
return post.data.authors && post.data.authors.includes(author.slug)
})
.sort((a, b) => b.data.date.valueOf() - a.data.date.valueOf())
---
@ -51,7 +46,7 @@ const authorPosts = allPosts
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink href="/"
><HomeIcon className="h-4 w-4" /></BreadcrumbLink
><HomeIcon className="size-4" /></BreadcrumbLink
>
</BreadcrumbItem>
<BreadcrumbSeparator />