--- import { render } from 'astro:content'; import '../styles/global.css'; import SiteHeader from '../components/SiteHeader.astro'; import PromoBanner from '../components/PromoBanner.astro'; import { formatDate, relativeTime, readingMinutes, shareImage, type Post } from '../lib/posts'; interface Props { post: Post; } const { post } = Astro.props; const { entry, category, date, url, isHtml } = post; const { title, image, excerpt } = entry.data; const siteTitle = 'Scott Chacon'; const shareImg = shareImage(image); const shareDesc = (excerpt ?? '').replace(/\s+/g, ' ').trim().slice(0, 200); const showBanner = category === 'git' || category === 'tech'; const isoDate = date.toISOString(); const prettyDate = formatDate(date); const rel = relativeTime(date); const readMins = readingMinutes(entry.body ?? ''); // Markdown/MDX render through Astro's pipeline; raw-HTML posts inject verbatim. let Content: Awaited>['Content'] | undefined; if (!isHtml) { ({ Content } = await render(entry)); } --- {title} - {siteTitle}
{showBanner && }

{title}

{rel} {readMins} min read
{isHtml ? : Content && }