mirror of
https://github.com/Patiun/com.gregkilmer.www.git
synced 2026-11-07 19:58:24 +00:00
57721efbcd
Shelf game cards show the post about the game, as Library rows already do. A make's chip prefers its own build log and says Blog for other posts. Post chips and Connected pages count the links past the first few, so a roundup linking a hundred items stays readable. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012aSbo2D1qP8cMFQCykf7kx
27 lines
683 B
Plaintext
27 lines
683 B
Plaintext
---
|
|
/**
|
|
* A post's page chips. A roundup can link a hundred pages, so past the first
|
|
* few the rest are counted; the post itself links every one.
|
|
*/
|
|
import Chip from "@gk/ui/components/Chip.astro";
|
|
import type { PageLink } from "../../lib/blog.ts";
|
|
|
|
interface Props {
|
|
links: PageLink[];
|
|
max?: number;
|
|
}
|
|
const { links, max = 5 } = Astro.props;
|
|
const shown = links.length > max + 1 ? links.slice(0, max) : links;
|
|
const more = links.length - shown.length;
|
|
---
|
|
{shown.map((l) => <Chip href={l.href}>{l.label}</Chip>)}
|
|
{more > 0 && <span class="more">and {more} more</span>}
|
|
|
|
<style>
|
|
.more {
|
|
font-size: 12px;
|
|
color: var(--gk-muted);
|
|
white-space: nowrap;
|
|
}
|
|
</style>
|