Skip to content

feat: lay out the latest blog posts as cards - #220

Merged
magnus-madsen merged 1 commit into
masterfrom
blog-posts-as-cards
Aug 9, 2026
Merged

feat: lay out the latest blog posts as cards#220
magnus-madsen merged 1 commit into
masterfrom
blog-posts-as-cards

Conversation

@magnus-madsen

Copy link
Copy Markdown
Member

Puts each of the three latest posts on /blog/ in a card, stacked full width. It was the last listing on the site rendered as bare text: /documentation, /contribute, /vscode, /principles and /faq all put their items in a box, and this page did not.

The shape is the FAQ's — FAQ/QA.astro is a .card mb-3 per question — rather than a three-across grid like /contribute's Projects row. The grid fills the width better with summaries this short, but it would be tied to the post count: recentPosts() defaults to three (blogPosts.js), and raising that to four would leave a row of three plus an orphan. A stack takes any number.

What the markup does

The card class goes on the <li> itself. A wrapper <div class="card"> inside the item would only restate what the list item already is, and .card is display: flex in Bootstrap, so the element carrying it stops being a marker box either way.

The heading moves from .h5 to .card-title, which is what every other card on the site labels itself with (vscode.astro, contribute.astro). It resolves to 1.2rem through global.css instead of Bootstrap's 1.25rem — 0.05rem smaller, and now one class rather than a heading level chosen by eye. mb-1 still overrides the title's own spacer so the date line stays tucked under it, and the summary picks up .card-text.

The date, the author, and the middot that separates them are untouched.

No CSS

.card resolves to --bs-body-bg, the same surface .page paints, so a card here is a hairline border and padding rather than a second background colour. Nothing to define, and dark mode was already covered by the border and body tokens.

The comment above the list is rewritten: list-unstyled was there because markers sat oddly against multi-line entries, and the reason is now that a marker would sit outside the box entirely, level with the border instead of the text it belongs to.

Checked

npx astro build passes and the emitted /blog/index.html carries the intended structure. The dark-mode claim above is read off the tokens, not off a screenshot.

🤖 Generated with Claude Code

Each post on /blog/ becomes a full-width card, the same shape the FAQ
gives each question. It was the one listing on the site not in a box.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@magnus-madsen
magnus-madsen merged commit 89374c4 into master Aug 9, 2026
2 checks passed
@magnus-madsen
magnus-madsen deleted the blog-posts-as-cards branch August 9, 2026 18:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant