Skip to content

fix: hide Featured section when there are no featured posts - #193

Open
jatinder14 wants to merge 1 commit into
TryGhost:mainfrom
jatinder14:fix/hide-empty-featured-section
Open

fix: hide Featured section when there are no featured posts#193
jatinder14 wants to merge 1 commit into
TryGhost:mainfrom
jatinder14:fix/hide-empty-featured-section

Conversation

@jatinder14

@jatinder14 jatinder14 commented Jul 30, 2026

Copy link
Copy Markdown

Summary

  • With `show_featured_posts` enabled but no featured posts, Source still rendered an empty Featured heading/section.
  • Wrap the section in `{{#if featured}}` so it only appears when the query returns posts (same approach as Dawn).

Test plan

  • Enable featured posts in Source design settings with zero featured posts → Featured block is gone
  • Mark a post featured → Featured block appears with that post

Closes #95

The Featured block always rendered its heading even when the featured
query returned nothing. Gate the section on the collection, matching
the Dawn theme pattern.

Closes TryGhost#95
@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

The featured template now wraps the featured section in an {{#if featured}} guard. When the posts query returns a truthy featured value, the title, feed container, and featured post cards render; otherwise, the section is omitted.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR satisfies #95 by preventing the Featured row from rendering when there are no featured posts.
Out of Scope Changes check ✅ Passed The changes appear limited to the Featured section condition and do not introduce unrelated scope.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title clearly summarizes the main change: hiding the Featured section when no featured posts exist.
Description check ✅ Passed The description directly matches the change and test plan, describing the empty Featured section fix.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

[BUG] Featured row shows on blog without featured articles

1 participant