Make link cards smaller, up to three in a row

One grid whatever the count, so a lone card takes a column rather than
the width. Also the Blog Posts request folder's name, as it is in Drive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Zaldimmar 2026-09-29 23:21:48 -05:00
parent a98aea6bca
commit 9ff1cd6e99
4 changed files with 13 additions and 10 deletions

View file

@ -24,8 +24,9 @@
a fold-out of description, media, map);
text is an optional intro. ScheduleBlock
table text: a row per line, cells split by |
cards items as link cards: text the title,
detail, url, media the picture
cards items as link cards, up to three in a row:
text the title, detail, url, media the
picture
divider nothing
"Formatted" is InlineText.tsx: **bold**, *italic*, [text](url),
@ -95,10 +96,10 @@ function LinkCard({ item }: { item: ContentBlockItem }) {
{!img.failed && (
<img src={img.src} alt="" loading="lazy" onError={img.onError} className="aspect-video w-full object-cover" />
)}
<span className="flex flex-1 flex-col gap-1 p-5">
<span className="text-xs font-semibold text-muted">{where}</span>
<span className="font-display text-lg font-bold leading-snug text-ink group-hover:text-link">{item.text}</span>
{item.detail && <span className="line-clamp-3 text-sm text-body">{item.detail}</span>}
<span className="flex flex-1 flex-col gap-1 p-4">
<span className="truncate text-xs font-semibold text-muted">{where}</span>
<span className="font-display text-base font-bold leading-snug text-ink group-hover:text-link">{item.text}</span>
{item.detail && <span className="line-clamp-3 text-sm leading-snug text-body">{item.detail}</span>}
</span>
</Anchor>
)
@ -224,7 +225,9 @@ function Block({ block, accent, anchor }: { block: ContentBlock; accent: string;
const cards = (block.items ?? []).filter((item) => item.url && item.text)
if (cards.length === 0) return null
return (
<ul className={cards.length === 1 ? 'max-w-xl' : 'grid gap-4 sm:grid-cols-2'}>
// One grid whatever the count: a lone card takes a column
// rather than the width, and more sit up to three in a row.
<ul className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
{cards.map((item, i) => (
<li key={i}>
<LinkCard item={item} />

View file

@ -279,7 +279,7 @@ export const BLOCK_TYPES = [
["video", "Video", "A YouTube, Vimeo or Facebook video, or a video file, played in place."],
["schedule", "Schedule", "Entries in one tab per day, each folding out for more. The text is an optional intro."],
["table", "Table", "A grid of text, eg. a comparison chart: one row per line, cells split by |, the first row the header."],
["cards", "Link cards", "Cards with a picture, title and description, each a link, like a link shared in a chat. Paste a link and press Fetch preview."],
["cards", "Link cards", "Cards with a picture, title and description, each a link to a page or a file, like a link shared in a chat; up to three in a row. Paste a link and press Fetch preview, or Choose a file."],
["divider", "Divider", "A thin line between parts."],
];