diff --git a/src/lib/utils.ts b/src/lib/utils.ts index c07f950..8f1987d 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -28,6 +28,7 @@ export async function parseAuthors(authors: string[]) { try { const author = await getEntry('authors', slug) return { + slug, name: author?.data?.name || slug, avatar: author?.data?.avatar || '/static/logo.png', isRegistered: !!author, @@ -35,6 +36,7 @@ export async function parseAuthors(authors: string[]) { } catch (error) { console.error(`Error fetching author with slug ${slug}:`, error) return { + slug, name: slug, avatar: '/static/logo.png', isRegistered: false, diff --git a/src/pages/blog/[...slug].astro b/src/pages/blog/[...slug].astro index 9ea6dd3..e233e71 100644 --- a/src/pages/blog/[...slug].astro +++ b/src/pages/blog/[...slug].astro @@ -103,7 +103,7 @@ const authors = await parseAuthors(post.data.authors ?? []) /> {author.isRegistered ? (