| 1 | import { allChangelogs } from 'content-collections' |
| 2 | import { format } |
| 3 | import type { Metadata |
| 4 | import Image from 'next/image |
| 5 | import Link from 'next/link |
| 6 | import { createMetadata } |
| 7 | |
| 8 | export const metadata: |
| 9 | title: 'All Changelogs', |
| 10 | description: 'Every release, improvement, and fix shipped to Saturn.', |
| 11 | openGraph: { |
| 12 | images: `/api/og?page=${encodeURIComponent |
| 13 | }, |
| 14 | twitter: { |
| 15 | images: `/api/og?page=${encodeURIComponent |
| 16 | }, |
| 17 | }) |
| 18 | |
| 19 | export default function ChangelogsGridPage |
| 20 | const entries = |
| 21 | a.date < |
| 22 | ) |
| 23 | |
| 24 | return ( |
| 25 | <main className='mx-auto max-w-7xl px-6 py-16 |
| 26 | <header className='mb-12 |
| 27 | <h1 className='font-bold text-4xl tracking-tight |
| 28 | <p className='mt-3 text-muted-foreground |
| 29 | Every release shipped to Saturn, in one place. |
| 30 | </p> |
| 31 | </header> |
| 32 | |
| 33 | <ul className='grid grid-cols-1 gap-6 md:grid-cols-2 lg:grid-cols-3 |
| 34 | {entries.map(( |
| 35 | const ogUrl = |
| 36 | return ( |
| 37 | <li key={entry |
| 38 | <Link |
| 39 | className='group block overflow-hidden rounded-xl border border-border bg-card transition hover:border-primary/40 hover:shadow-lg' |
| 40 | href={`/changelog/${entry |
| 41 | > |
| 42 | <div className='relative aspect-[1200/630] w-full overflow-hidden bg-muted |
| 43 | <Image |
| 44 | alt={entry.title |
| 45 | className='object-cover transition group-hover:scale-[1.02]' |
| 46 | fill |
| 47 | sizes='(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw' |
| 48 | src={ogUrl} |
| 49 | unoptimized |
| 50 | /> |
| 51 | </div> |
| 52 | <div className='p-5 |
| 53 | <div className='mb-2 flex items-center gap-2 text-muted-foreground text-xs |
| 54 | <time dateTime={entry |
| 55 | {format(new Date |
| 56 | </time> |
| 57 | {entry.version ? |
| 58 | <span className='rounded-full border border-border px-2 py-0.5 font-mono |
| 59 | v{entry.version} |
| 60 | </span> |
| 61 | ) : null} |
| 62 | </div> |
| 63 | <h2 className='font-semibold text-lg tracking-tight |
| 64 | {entry.title} |
| 65 | </h2> |
| 66 | <p className='mt-2 line-clamp-2 text-muted-foreground text-sm |
| 67 | {entry.description} |
| 68 | </p> |
| 69 | </div> |
| 70 | </Link> |
| 71 | </li> |
| 72 | ) |
| 73 | })} |
| 74 | </ul> |
| 75 | </main> |
| 76 | ) |
| 77 | } |