feat: revamped author card

This commit is contained in:
enscribe 2024-09-12 18:08:19 -07:00
parent c410c499e1
commit 2211c4bbf3
No known key found for this signature in database
GPG key ID: 9BBD5C4114E25322
46 changed files with 566 additions and 426 deletions

View file

@ -1,5 +1,5 @@
import { getEntry } from 'astro:content'
import { clsx, type ClassValue } from 'clsx'
import { type ClassValue, clsx } from 'clsx'
import { twMerge } from 'tailwind-merge'
export function cn(...inputs: ClassValue[]) {
@ -29,14 +29,14 @@ export async function parseAuthors(authors: string[]) {
const author = await getEntry('authors', slug)
return {
name: author?.data?.name || slug,
avatar: author?.data?.avatar || '/static/512x512.png',
avatar: author?.data?.avatar || '/static/logo.png',
isRegistered: !!author,
}
} catch (error) {
console.error(`Error fetching author with slug ${slug}:`, error)
return {
name: slug,
avatar: '/static/512x512.png',
avatar: '/static/logo.png',
isRegistered: false,
}
}