Skip to content

Fix broken images when project image is empty - #255

Open
DarkaMaul wants to merge 1 commit into
gurusabarish:masterfrom
DarkaMaul:fix/broken-images-empty-project-image
Open

Fix broken images when project image is empty#255
DarkaMaul wants to merge 1 commit into
gurusabarish:masterfrom
DarkaMaul:fix/broken-images-empty-project-image

Conversation

@DarkaMaul

Copy link
Copy Markdown

When a project has image: "" or no image set, the template renders an with an empty src, which resolves to the site's baseURL. This results in a broken/invisible 0x0 image that loads the homepage HTML as an image source.

This PR wraps the card-head image block in a conditional so the element is only rendered when an image is actually provided.

Screenshots:

  • Before:
Capture d’écran 2026-03-25 à 09 57 31
  • After:
Capture d’écran 2026-03-25 à 09 59 05

When a project has `image: ""` or no image set, the template renders
an <img> with an empty src, which resolves to the site's baseURL.
This results in a broken/invisible 0x0 image that loads the homepage
HTML as an image source.

Wrap the card-head image block in a conditional so the <img> element
is only rendered when an image is actually provided. Applied to all
three project templates: config-based items, page-based items on the
home page, and the projects list page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

1 participant