diff --git a/package-lock.json b/package-lock.json index 927a615..dbecfd8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -52,6 +52,9 @@ "tailwindcss": "^4.1.18", "tw-animate-css": "^1.4.0", "typescript": "^5.9.3" + }, + "engines": { + "node": ">=20.0.0" } }, "node_modules/@alloc/quick-lru": { diff --git a/src/app/docs/[[...slug]]/page.tsx b/src/app/docs/[[...slug]]/page.tsx index 8a89b46..c1945cf 100644 --- a/src/app/docs/[[...slug]]/page.tsx +++ b/src/app/docs/[[...slug]]/page.tsx @@ -67,16 +67,7 @@ export default async function Page(props: PageProps<"/docs/[[...slug]]">) { {data.description} {data.authors && data.authors.length > 0 && (
- {data.authors.map((author: string) => ( - - ))} +
)}
diff --git a/src/components/blog/AuthorCard.tsx b/src/components/blog/AuthorCard.tsx index e6ae58a..e6070ce 100644 --- a/src/components/blog/AuthorCard.tsx +++ b/src/components/blog/AuthorCard.tsx @@ -6,6 +6,7 @@ interface AuthorCardProps { author?: string; authorURL?: string; authorImageURL?: string; + authors?: string[]; date?: string; readTime?: string; className?: string; @@ -37,10 +38,93 @@ export function AuthorCard({ author, authorURL, authorImageURL, + authors, date, readTime, className, }: AuthorCardProps) { + // Handle multiple authors case + if (authors && authors.length > 0) { + const formattedDate = date + ? new Date(date).toLocaleDateString("en-US", { + month: "short", + day: "numeric", + year: "numeric", + }) + : null; + + return ( +
+ {authors.flatMap((authorName, index) => { + const githubUrl = `https://github.com/${encodeURIComponent(authorName)}`; + const avatarUrl = !authorName.includes(" ") + ? `https://github.com/${encodeURIComponent(authorName)}.png` + : null; + + const elements = []; + + if (avatarUrl) { + elements.push( +
+ + + + {authorName.charAt(0).toUpperCase()} + + +
, + ); + } + + elements.push( +
+ + {authorName} + +
, + ); + + if (index < authors.length - 1) { + elements.push( + , + ); + } + + return elements; + })} + + {readTime && ( + <> + + {readTime} read + + )} + + {formattedDate && ( + <> + + + + )} +
+ ); + } + + // Handle single author case (backward compatibility) if (!author && !date) return null; const githubUrl = sanitizeAuthorUrl(authorURL);