From dd8d54c19ae63994dfff81cb2be69bdc678aa2b3 Mon Sep 17 00:00:00 2001 From: Twill Date: Mon, 4 May 2026 09:15:19 +0000 Subject: [PATCH] fix(theme): use explicit .post-description class for blog listing description 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 --- themes/beaver/assets/css/homepage-layout.css | 4 ++-- themes/beaver/layouts/blog/list.html | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/themes/beaver/assets/css/homepage-layout.css b/themes/beaver/assets/css/homepage-layout.css index b962930bd..548efcbbd 100644 --- a/themes/beaver/assets/css/homepage-layout.css +++ b/themes/beaver/assets/css/homepage-layout.css @@ -2668,7 +2668,7 @@ span.pp-accordion-button-icon { line-height: 1.35; } -.post-content > div:last-child { +.post-description { font-size: 0.85em; line-height: 1.5; color: #555; @@ -2677,6 +2677,6 @@ span.pp-accordion-button-icon { @media (max-width: 860px) { .post-title { font-size: 1em; } - .post-content > div:last-child { display: none; } + .post-description { display: none; } .post-meta .post-tags { display: none; } } \ No newline at end of file diff --git a/themes/beaver/layouts/blog/list.html b/themes/beaver/layouts/blog/list.html index dcd43cf6e..89835b27b 100644 --- a/themes/beaver/layouts/blog/list.html +++ b/themes/beaver/layouts/blog/list.html @@ -89,7 +89,7 @@

{{ .Title }}

{{ end }} -
{{ .Params.description }}
+
{{ .Params.description }}