regarding the change in Prismic of not supporting SVG files, do I need to replace all the .svg files in the media library before triggering any deploy? All the images that look / broken missing in staging, will they still display?
The SVG's should be replaced by other image formats in articles that you republish, this would be the easiest way. In articles that aren't updated the images shouldn't break.
There's also the workaround we showed in the blog article that you can implement to remove any query string params that you add in your project from SVG's:
function modifyImageUrl(imageUrl) {
function includesMatch(lookupValue, urlString) {
const re = new RegExp(lookupValue, 'i');
return urlString.match(re) !== null;
}
if (includesMatch("images.prismic", imageUrl)) {
return `${imageUrl}&h=60&dpr=2`;
}
return imageUrl;
}
const imageUrl = modifyImageUrl(document.data.imageField.url)
Other wise SVG's will still work as long as you don't add URL string parameters, they'll just be served from our Amazon servers and not through Imgix.
Let me know if you have any further questions about this.
Thanks.
1 Like
Phil
(Phil Snow)
closed , flag & select 'Something Else' to reopen.
5
This issue has been closed due to inactivity. Flag to reopen.