Skip to content

Add explicit CSS class for blog post description in listing #296

Description

@pftg

Context

From PR #294 code review (CodeRabbit).

The blog listing description is targeted with .post-content > div:last-child — a fragile positional selector that breaks if the template markup changes.

Current state

themes/beaver/layouts/blog/list.html renders the description as a bare <div>:

<div>{{ .Params.description }}</div>

CSS in homepage-layout.css:

.post-content > div:last-child {
  font-size: 0.85em;
  line-height: 1.5;
  color: #555;
  margin-top: 6px;
}

Proposed fix

  1. Add class="post-description" to the div in list.html
  2. Update CSS selector from .post-content > div:last-child to .post-description

Why not now

This was a CSS-only PR. Adding a template change mixes concerns. The current selector works with the existing markup.

Files

  • themes/beaver/layouts/blog/list.html (~line 99)
  • themes/beaver/assets/css/homepage-layout.css (~line 2670)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions