Ghost themes support automatic image resizing, allowing you to use a minimal handlebars helper to output different image sizes.
package.json
file. Ghost automatically generates copies of images at the specified sizes, and works like a cache, so the image sizes can be changed at any time. It’s recommended to have no more than 10 image sizes so media storage doesn’t grow out of control.
Here’s a sample of the image sizes in Ghost’s default Casper theme.
size
parameter to the {{img_url}} helper in your theme to output an image at a particular size.
format
parameter to the {{img_url}} helper in your theme to output an image in a particular image format. This only works in combination with the size
parameter.
.jpg
extension.
WebP is supported by all modern browsers, but we recommend to always add a fallback to the original file type to achieve wider browser support. Use a <picture>
tag for this, which allows the browser to choose the first format it supports: