Use explicit .post-description class for blog listing description (closes #296)#320
Merged
pftg merged 1 commit intoMay 4, 2026
Conversation
…cription Replaces the fragile positional selector `.post-content > div:last-child` with an explicit `.post-description` class. The positional selector breaks silently if the blog post card markup grows another trailing element. - themes/beaver/layouts/blog/list.html: add class="post-description" to the div rendering .Params.description - themes/beaver/assets/css/homepage-layout.css: replace selector in both the main rule and the @media (max-width: 860px) rule; rule body unchanged (font-size 0.85em, line-height 1.5, color #555, margin-top 6px) Verified: 10 .post-description elements render on /blog/ index, computed styles match pre-change values (15.3px / 22.95px / rgb(85,85,85) / 6px), and the mobile media query still hides the description at 375px. Hugo build passes. Closes #296 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task created from Twill by Paul Keen.
Summary
Replaces the fragile positional selector
.post-content > div:last-childwith an explicit.post-descriptionclass on the blog post listing description. Closes #296.The positional selector breaks silently if the post card markup grows another trailing element. An explicit class survives template restructuring.
Changes
themes/beaver/layouts/blog/list.html— addedclass="post-description"to the<div>rendering.Params.description.themes/beaver/assets/css/homepage-layout.css— replaced selector in both the main rule and the@media (max-width: 860px)rule. Rule body is identical (font-size: 0.85em,line-height: 1.5,color: #555,margin-top: 6px).Verification
bin/hugo-buildpassed (Hugo 0.161.1, matches CI)..post-descriptionelements render on/blog/index.font-size: 15.3px(= 0.85em)line-height: 22.95px(= 1.5)color: rgb(85, 85, 85)(= #555)margin-top: 6pxwindow.innerWidth = 375):display: none— media query still hides description.rgconfirms no other rule depended on.post-content > div:last-childand no other consumer references it.Visual evidence
Desktop (1280px) — descriptions visible:
Mobile (375px) — descriptions hidden by media query, matching pre-change behavior:
Note on test gates
The CLAUDE.md visual regression gate normally runs
bin/testandbin/dtest. Those Ruby/Docker harnesses are not available in this sandbox, so this PR substitutes:CSS specificity does increase from
(0,0,2)to(0,1,0), but the rule sits in a self-contained block with no competing selectors targeting.post-description, so behavior is preserved.Test plan
_hugo.yml) passes/blog/description rendering on the Preview (desktop + < 860px viewport)bin/testandbin/dtestlocally if visual baseline parity is requiredView on Twill
You can tag
@twillanywhere in this PR to follow up.