Skip to content
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

Swap Image for <img /> when loading from Wagtail #141

Merged
merged 2 commits into from
Nov 7, 2022

Conversation

antw
Copy link
Contributor

@antw antw commented Nov 7, 2022

Many images are coming from Wagtail and (I think?) cannot be loaded with next/image unless the image is available at compile time. I'm swapping out Image for plain <img /> tags for now, in hope that this allows the images to be loaded from Wagtail.

This fixes when images are loaded as part of a TextAndMedia block, or in a Card block, but does not fix if you try to embed an image as part of the rich text for a page. In that case, Wagtail is returning an <embed /> tag which isn't useful. It doesn't even include an src attribute. Is this something that can be fine-tuned in Wagtail?

Ref #140

Many images are coming from Wagtail and (I think?) cannot be loaded with
next/image unless the image is available at compile time. I'm swapping
out `Image` for plain `<img />` tags for now, in hope that this allows
the images to be loaded from Wagtail.

Ref #140
@mattijsstam mattijsstam merged commit 286ac48 into main Nov 7, 2022
@mattijsstam mattijsstam deleted the 140-fix-images-in-production branch November 7, 2022 20:16
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.

2 participants