Link roundup posts from Shelf cards and keep long link lists short

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
This commit is contained in:
Claude
2026-10-18 17:08:43 +00:00
parent b3cf6bd02e
commit 57721efbcd
10 changed files with 89 additions and 20 deletions
@@ -13,7 +13,7 @@ import WorldSection from "../../components/world/WorldSection.astro";
import type { Note } from "../../lib/content.ts";
import { plural, site } from "../../lib/page.ts";
import { formatDate, mediaSrc } from "../../lib/site.ts";
import { buildLogs, byDateDesc, byOrder, craftPill, craftSeal, makePhotos, makesOf, sentence, toolsOf } from "../../lib/world.ts";
import { buildLogs, byDateDesc, byOrder, craftPill, craftSeal, makeLog, makePhotos, makesOf, sentence, toolsOf } from "../../lib/world.ts";
const s = await site();
const slug = Astro.params.slug ?? "";
@@ -115,7 +115,7 @@ const postCover = (p: Note<"post">) => mediaSrc((p.data as { cover?: string }).c
<ul class="makes">
{makes.map((m) => {
const photos = makePhotos(m);
const log = s.backlinks(m, { type: "post" })[0];
const log = makeLog(s, m);
return (
<li id={m.slug} class="make" data-k={kindsOf(m).map((k) => k.toLowerCase()).join("|") || "-"}>
<StarChartArt seal={artSeal} ratio="auto" src={photos[0]} alt={m.data.blurb ?? m.title} class="m-art" />
@@ -132,7 +132,7 @@ const postCover = (p: Note<"post">) => mediaSrc((p.data as { cover?: string }).c
{(m.data.date || log) && (
<span class="m-meta">
{m.data.date && <time datetime={m.data.date}>{formatDate(m.data.date)}</time>}
{log && <Chip href={s.href(log) ?? undefined}>Build log</Chip>}
{log && <Chip href={s.href(log) ?? undefined}>{log.data.postType === "build log" ? "Build log" : "Blog"}</Chip>}
</span>
)}
</span>
+2 -2
View File
@@ -13,7 +13,7 @@ import NowStrip, { type NowItem } from "../../components/world/NowStrip.astro";
import WorldSection from "../../components/world/WorldSection.astro";
import type { Note } from "../../lib/content.ts";
import { plural, site } from "../../lib/page.ts";
import { buildLogs, byDateDesc, byOrder, craftPill, craftSeal, isSword, makePhotos, makesOf, statusesFor, toolsAt, toolsOf } from "../../lib/world.ts";
import { buildLogs, byDateDesc, byOrder, craftPill, craftSeal, isSword, makeLog, makePhotos, makesOf, statusesFor, toolsAt, toolsOf } from "../../lib/world.ts";
const s = await site();
const text = s.pageText("/workshop");
@@ -153,7 +153,7 @@ const nowItems: NowItem[] = statusesFor(s, "/workshop").map((st) => {
{recent.map((m) => {
const found = s.byName(m.data.craft);
const craft = found?.type === "craft" ? (found as Note<"craft">) : undefined;
const log = s.backlinks(m, { type: "post" })[0];
const log = makeLog(s, m);
return (
<li class="r-card">
<a href={s.href(m) ?? undefined} class="r-art">
+3 -3
View File
@@ -10,7 +10,7 @@ import Button from "@gk/ui/components/Button.astro";
import type { Note } from "../../lib/content.ts";
import { plural, site } from "../../lib/page.ts";
import { formatDate } from "../../lib/site.ts";
import { byDateDesc, byOrder, craftSeal, makePhotos } from "../../lib/world.ts";
import { byDateDesc, byOrder, craftSeal, makeLog, makePhotos } from "../../lib/world.ts";
const s = await site();
const text = s.pageText("/workshop/makes");
@@ -46,7 +46,7 @@ const pills =
{makes.map((m) => {
const craft = craftOf(m);
const photos = makePhotos(m);
const log = s.backlinks(m, { type: "post" })[0];
const log = makeLog(s, m);
return (
<li id={m.slug} class="make" data-c={craft?.slug ?? "-"}>
<StarChartArt seal={(craft && craftSeal(craft)) ?? pageSeals.workshop} ratio="auto" src={photos[0]} alt={m.data.blurb ?? m.title} class="m-art" />
@@ -61,7 +61,7 @@ const pills =
{(m.data.date || log) && (
<span class="m-meta">
{m.data.date && <time datetime={m.data.date}>{formatDate(m.data.date)}</time>}
{log && <Chip href={s.href(log) ?? undefined}>Build log</Chip>}
{log && <Chip href={s.href(log) ?? undefined}>{log.data.postType === "build log" ? "Build log" : "Blog"}</Chip>}
</span>
)}
</span>