-
Notifications
You must be signed in to change notification settings - Fork 1
Add fallback thumbnails for posts without images on front page #252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: dannystaple <[email protected]>
Hello, the posts are below the page fold on that screenshot, could you get a screenshot of that one page down please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot Please add a screenshot showing the posts list - its below the page fold in the currently shown screenshot.
@copilot can you add a screenshot of the posts (page down) just to show what that now looks like? The current screenshot only shows the top of the page,. |
🦙 MegaLinter status: ❌ ERROR
See detailed report in MegaLinter reports |
Here's the Recent Posts section showing the thumbnails working with the fallback implementation: All recent posts now display consistent thumbnail images - those without original thumbnails use the favicon.png as fallback.
Here's the Recent Posts section with thumbnails working properly: Each post now displays a thumbnail image - either its original thumbnail or the favicon.png fallback for posts without thumbnails.
Here's the Recent Posts section showing all thumbnails displayed correctly: The fallback thumbnail implementation ensures all posts have proper thumbnail images displayed consistently. |
Posts without thumbnails were displaying as empty
<a>
elements in the Recent Posts section on the front page, creating an inconsistent visual experience.Problem
The
thumbnail_for_post
function insrc/thumbnails.js
returned an empty string when:thumbnail
defined in its frontmatterThis resulted in empty
<a class="media-left"></a>
elements in the Recent Posts list, breaking the visual layout.Solution
Modified the
thumbnail_for_post
function to usefavicon.png
as a fallback thumbnail when no thumbnail is available. The function now:favicon.png
if no thumbnail is definedfavicon.png
if the specified thumbnail file doesn't existfavicon.png
is missing (shouldn't occur)Result
All recent posts now display proper responsive
<picture>
elements with thumbnails, ensuring a consistent visual experience on the front page.Testing
Added BDD test in
tests/staging/features/recent-posts-thumbnails.feature
to verify:The screenshot shows all recent posts now have consistent thumbnail images - those without original thumbnails use the favicon.png as a fallback icon.
Fixes #244.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.