feat: display author, tags, and reading time on post pages and cards

This commit is contained in:
2026-06-01 21:37:57 -05:00
parent 6888df0c76
commit fac252efa9
2 changed files with 24 additions and 5 deletions

View File

@@ -8,7 +8,7 @@ interface PostCardProps extends PostMeta {
index?: number;
}
export function PostCard({ slug, title, date, excerpt, index = 0 }: PostCardProps) {
export function PostCard({ slug, title, date, excerpt, index = 0, tags = [] }: PostCardProps) {
return (
<m.article
initial={{ opacity: 0, y: 20 }}
@@ -22,8 +22,17 @@ export function PostCard({ slug, title, date, excerpt, index = 0 }: PostCardProp
<h3 className="heading-md text-ink mt-1 mb-2 hover:text-accent transition-colors">
{title}
</h3>
{tags && tags.length > 0 && (
<div className="flex flex-wrap gap-1 mt-2">
{tags.slice(0, 3).map((tag) => (
<span key={tag} className="rounded bg-surface px-2 py-0.5 text-xs text-ink-soft">
{tag}
</span>
))}
</div>
)}
{excerpt && (
<p className="text-ink-soft leading-7">{excerpt}</p>
<p className="text-ink-soft leading-7 mt-2">{excerpt}</p>
)}
</Link>
</m.article>