diff --git a/.og/gen/posts-list-mobile.png b/.og/gen/posts-list-mobile.png new file mode 100644 index 0000000..878f6ec Binary files /dev/null and b/.og/gen/posts-list-mobile.png differ diff --git a/.og/gen/posts-list-preview.png b/.og/gen/posts-list-preview.png new file mode 100644 index 0000000..be77957 Binary files /dev/null and b/.og/gen/posts-list-preview.png differ diff --git a/src/components/PostList.astro b/src/components/PostList.astro index 9c14a5c..31e3a8a 100644 --- a/src/components/PostList.astro +++ b/src/components/PostList.astro @@ -11,27 +11,34 @@ const shown = limit ? posts.slice(0, limit) : posts; const fmt = (d: Date) => d.toLocaleDateString('en-US', { year: 'numeric', month: 'long', day: 'numeric' }); + +const og = (post: CollectionEntry<'posts'>) => post.data.ogImage || '/og-default.png'; --- + \ No newline at end of file diff --git a/src/styles/global.css b/src/styles/global.css index 5591033..f89c03f 100644 --- a/src/styles/global.css +++ b/src/styles/global.css @@ -303,6 +303,42 @@ pre code { .post-list .updated { color: var(--brand); font-weight: 500; } .post-list p { color: var(--muted); margin: 0.4rem 0 0; } +/* Post list card: thumbnail (left) + text (right) on desktop */ +.post-list .post-row { + display: grid; + grid-template-columns: 1fr; + gap: 1rem; + align-items: start; +} +.post-list .thumb { + display: block; + border-radius: var(--radius); + overflow: hidden; + line-height: 0; + border: 1px solid var(--border); + background: var(--surface); +} +.post-list .thumb img { + width: 100%; + height: auto; + display: block; + aspect-ratio: 1200 / 630; + object-fit: cover; +} + +@media (min-width: 768px) { + .post-list .post-row { + grid-template-columns: 220px 1fr; + gap: 1.5rem; + align-items: center; + } +} +@media (min-width: 1024px) { + .post-list .post-row { + grid-template-columns: 260px 1fr; + } +} + /* ---------- Callouts (correct / wrong in tutorials) ---------- */ .callout { border-left: 3px solid var(--brand);