--- import AvatarComponent from '@/components/ui/avatar' import { Badge } from '@/components/ui/badge' import { Separator } from '@/components/ui/separator' import { getCombinedReadingTime, getSubpostCount, isSubpost, parseAuthors, } from '@/lib/data-utils' import { formatDate } from '@/lib/utils' import { Icon } from 'astro-icon/components' import { Image } from 'astro:assets' import type { CollectionEntry } from 'astro:content' import Link from './Link.astro' interface Props { entry: CollectionEntry<'blog'> } const { entry } = Astro.props const formattedDate = formatDate(entry.data.date) const readTime = await getCombinedReadingTime(entry.id) const authors = await parseAuthors(entry.data.authors ?? []) const subpostCount = !isSubpost(entry.id) ? await getSubpostCount(entry.id) : 0 ---
{ entry.data.image && (
{entry.data.title}
) }

{entry.data.title}

{entry.data.description}

{ authors.length > 0 && ( <> {authors.map((author) => (
{author.name}
))} ) } {formattedDate} {readTime} { subpostCount > 0 && ( <> {subpostCount} subpost{subpostCount === 1 ? '' : 's'} ) }
{ entry.data.tags && (
{entry.data.tags.map((tag) => ( {tag} ))}
) }