TL;DR
Ghost v5.7.0 introduces enhanced image handling capabilities with the new format option for the img-url helper, allowing conversion to WebP and AVIF formats for improved performance. It also extends the paywall card functionality to work with newsletters, providing a consistent content restriction experience across posts and newsletters. These updates empower theme developers to optimize image delivery and give publishers more control over premium newsletter content.
Highlight of the Release
- New format option for
img-url helper supporting WebP and AVIF image formats
- Extended paywall card functionality for newsletters
- Fixed Unsplash image resizing with the
img-url helper
Migration Guide
No migration steps are required for this release. The new features are opt-in and backward compatible with existing implementations.
For theme developers wanting to implement the new image format options:
- Update your theme to use the new format parameter with the
img-url helper
- Consider implementing responsive images using the
<picture> element for the best performance
Example implementation:
<picture>
<source
srcset="{{img_url feature_image size="s" format="avif"}} 300w,
{{img_url feature_image size="m" format="avif"}} 600w,
{{img_url feature_image size="l" format="avif"}} 1000w,
{{img_url feature_image size="xl" format="avif"}} 2000w"
sizes="(min-width: 1400px) 1400px, 92vw"
type="image/avif"
>
<source
srcset="{{img_url feature_image size="s" format="webp"}} 300w,
{{img_url feature_image size="m" format="webp"}} 600w,
{{img_url feature_image size="l" format="webp"}} 1000w,
{{img_url feature_image size="xl" format="webp"}} 2000w"
sizes="(min-width: 1400px) 1400px, 92vw"
type="image/webp"
>
<img
srcset="{{img_url feature_image size="s"}} 300w,
{{img_url feature_image size="m"}} 600w,
{{img_url feature_image size="l"}} 1000w,
{{img_url feature_image size="xl"}} 2000w"
sizes="(min-width: 1400px) 1400px, 92vw"
src="{{img_url feature_image size="xl"}}"
alt="{{#if feature_image_alt}}{{feature_image_alt}}{{else}}{{title}}{{/if}}"
>
</picture>
Upgrade Recommendations
This is a minor feature release that adds new capabilities without breaking changes. It is recommended for all users to upgrade to v5.7.0 to benefit from the new features and bug fixes.
The upgrade should be straightforward with no special considerations required. As always, it's recommended to:
- Back up your Ghost installation before upgrading
- Test the upgrade in a staging environment if possible
- Proceed with the upgrade in production
For self-hosted Ghost installations, follow the standard upgrade process using the Ghost-CLI:
ghost update
Bug Fixes
Fixed Unsplash Image Resizing
- Fixed an issue where the size property was being ignored for images from Unsplash when using the
img-url helper
- Unsplash images now properly resize according to the specified size parameter
New Features
Format Option for img-url Helper
The img-url helper now supports a new format parameter that allows converting images to different formats:
- Added support for converting images to WebP format
- Added support for AVIF format (high-compression next-gen format)
- Works in combination with the size parameter for local images
- Can be used independently for Unsplash images
Example usage:
{{img_url @site.cover_image size="s" format="webp"}}
This enhancement enables theme developers to implement modern responsive image solutions using the <picture> element with multiple format sources, significantly improving page performance.
Extended Paywall Card for Newsletters
The paywall card functionality has been extended to work with newsletters:
- Now inserts call-to-action elements in newsletters
- Restricts content for newsletters similar to how it works for posts
- Creates a consistent premium content experience across different content types
Security Updates
No security fixes were included in this release.
Performance Improvements
Image Format Optimization
The new format option for the img-url helper enables significant performance improvements:
- WebP images are typically 25-35% smaller than equivalent JPEG images at the same visual quality
- AVIF format offers even greater compression, often 50% smaller than JPEG
- Properly implemented responsive images with modern formats can reduce page weight and improve loading times
- Theme developers can now implement optimal image delivery strategies without custom code
Impact Summary
Ghost v5.7.0 enhances the platform's capabilities in two key areas: image optimization and premium content management.
The new format option for the img-url helper addresses a significant performance opportunity by enabling modern image formats (WebP and AVIF) that can reduce image sizes by 25-50% compared to traditional formats. This directly impacts site performance, page load times, and potentially SEO rankings.
The extension of the paywall card to newsletters creates a more consistent experience for publishers offering premium content. This feature streamlines the workflow for creating gated content across different publication formats and provides a unified experience for subscribers.
Both features represent Ghost's continued focus on empowering publishers with tools that improve both the creator and audience experience, without requiring technical expertise to implement advanced functionality.
Full Release Notes
- ✨ Added format option to
img-url helper (#14962) - Simon Backx
- ✨ Extended paywall card for newsletters - Rishabh Garg
View the changelogs for full details:
🪄 Love open source? We're hiring Node.js Engineers to work on Ghost full-time