mirror of
https://github.com/Patiun/com.gregkilmer.www.git
synced 2026-11-08 04:08:24 +00:00
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:
@@ -52,6 +52,12 @@ export function buildLogs(s: SiteIndex, craft: Note<"craft">): Note<"post">[] {
|
||||
return s.backlinks(craft, { type: "post" }) as Note<"post">[];
|
||||
}
|
||||
|
||||
/** The post a make links to: its own build log first, else the newest post about it. */
|
||||
export function makeLog(s: SiteIndex, make: Note<"make">): Note<"post"> | undefined {
|
||||
const posts = s.backlinks(make, { type: "post" }) as Note<"post">[];
|
||||
return posts.find((p) => p.data.postType === "build log") ?? posts[0];
|
||||
}
|
||||
|
||||
/** The tools of a craft, as notes where published, in the craft's order. */
|
||||
export function toolsOf(s: SiteIndex, craft: Note<"craft">): { title: string; note?: Note<"tool"> }[] {
|
||||
return (craft.data.tools ?? []).map((t) => {
|
||||
|
||||
Reference in New Issue
Block a user