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:
@@ -25,7 +25,9 @@ const status = site.statusFor(game);
|
||||
// Players and play time sync from BoardGameGeek; nothing shows until they have.
|
||||
const facts = [gamePlayers(game), gamePlayTime(game)].filter(Boolean);
|
||||
const seats = playersOf(game);
|
||||
const hasPost = site.backlinks(game, { type: "post" }).length > 0;
|
||||
const post = site.backlinks(game, { type: "post" })[0];
|
||||
const postHref = post && site.href(post);
|
||||
const hasPost = !!post;
|
||||
---
|
||||
<li
|
||||
id={game.slug}
|
||||
@@ -61,9 +63,19 @@ const hasPost = site.backlinks(game, { type: "post" }).length > 0;
|
||||
</div>
|
||||
)
|
||||
}
|
||||
<a class="gk-text gk-quiet bgg" href={`https://boardgamegeek.com/boardgame/${d.bggId}`} rel="external noopener">
|
||||
BoardGameGeek<span class="gk-visually-hidden">: {game.title}</span>
|
||||
</a>
|
||||
<span class="links">
|
||||
{
|
||||
post && postHref && (
|
||||
<a href={postHref} class="blog">
|
||||
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 5h16v14H4zM8 9h8M8 13h5" /></svg>
|
||||
Blog: {post.title}
|
||||
</a>
|
||||
)
|
||||
}
|
||||
<a class="gk-text gk-quiet bgg" href={`https://boardgamegeek.com/boardgame/${d.bggId}`} rel="external noopener">
|
||||
BoardGameGeek<span class="gk-visually-hidden">: {game.title}</span>
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
</Card>
|
||||
</li>
|
||||
@@ -134,10 +146,24 @@ const hasPost = site.backlinks(game, { type: "post" }).length > 0;
|
||||
font-size: 12px;
|
||||
color: var(--gk-muted);
|
||||
}
|
||||
.bgg {
|
||||
align-self: flex-start;
|
||||
.links {
|
||||
margin-top: auto;
|
||||
padding-top: 4px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: flex-start;
|
||||
gap: 6px;
|
||||
}
|
||||
.blog {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 13px;
|
||||
font-weight: 600;
|
||||
color: var(--gk-teal-bright);
|
||||
}
|
||||
.bgg {
|
||||
align-self: flex-start;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user