mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 14:22:07 +03:00
84724537be
closes https://github.com/TryGhost/Team/issues/675 Outlook will display images at their native resolution if no `width` attribute is supplied. Content images were fixed a while ago but feature images would still render very wide and cause horizontal scroll and text size/alignment issues. - modify `post.feature_image` and add a `post.feature_image_width` property before passing it through to the email template - for Unsplash images we assume all images are larger than 600px so we change the URL to reference a 1200px image and set the image width to 600 (to keep images on retina displays crisp) - for other images we probe the image to fetch the original dimensions and give set an image width of 600 if needed, if it's a locally-hosted image we update the URL to point at a max 1200px version - updated email template to output a `width` attribute on the feature image `<img>` tag if it's set |
||
---|---|---|
.. | ||
index.js | ||
mega.js | ||
post-email-serializer.js | ||
template.js |