Home

>

Tools

>

Ghost

>

Releases

>

5.1.0

Ghost Release: 5.1.0

Tag Name: v5.1.0

Release Date: 5/27/2022

Ghost LogoGhost

Open-source publishing platform specifically designed for professional bloggers and publications. Focuses on clean, minimalist writing and publishing experience.

TL;DR

Ghost 5.1.0 introduces several enhancements to dynamic routing, image handling, and fixes important bugs. Pages can now be used as posts in dynamic routing, favicon requirements have been reduced with support for more image formats, and reading time calculation for RTL languages has been fixed. This release focuses on improving flexibility for developers and content creators while addressing key usability issues.

Highlight of the Release

    • Pages can now be used as posts in dynamic routing, solving a long-standing limitation
    • Expanded favicon support with more image formats (.jpg, .jpeg, .gif, .webp, .svg) and less restrictive requirements
    • Added image format conversion capabilities via URL parameters
    • Fixed reading time calculations for RTL languages
    • Fixed gscan theme compatibility detection for files in folders

Migration Guide

Dynamic Routing Changes

If you're using custom dynamic routes with pages, you can now access pages as either .page or .post in your routes. This provides backward compatibility while adding new functionality.

Favicon Changes

  • Custom favicons are no longer served via /favicon.png or /favicon.ico (only for default favicon), but use their full path
  • If you're programmatically working with favicons, be aware that more formats are now supported and automatically converted as needed

Image Formatting

If you're using the image manipulation features, you can now specify format conversion:

  • Original URL: https://yourdomain.com/content/images/2022/05/image.gif
  • To resize: https://yourdomain.com/content/images/size/w256h256/2022/05/image.gif
  • To resize and format to webp: https://yourdomain.com/content/images/size/w256h256/format/webp/2022/05/image.gif

Upgrade Recommendations

This is a minor version update (5.0.2 → 5.1.0) that introduces several useful features and important bug fixes without breaking changes. We recommend all users upgrade to this version, especially if you:

  • Use dynamic routing with pages
  • Work with RTL language content
  • Need more flexibility with favicon images
  • Want to take advantage of the new image formatting capabilities

The upgrade should be straightforward with no breaking changes reported. As always, it's recommended to backup your database before upgrading and test the upgrade in a staging environment if possible.

Bug Fixes

Reading Time for RTL Languages

  • Fixed reading time calculation for right-to-left (RTL) languages
  • Updated word count helper to properly handle RTL text
  • Resolves issues #14365, #366, and #389

GScan Theme Compatibility Detection

  • Fixed issue where gscan wasn't detecting compatibility issues in theme folders
  • Ensures linter-based rules run on all theme files, including those in subdirectories
  • Addresses issue reported in the Ghost forum

Product Card Formatting

  • Fixed issue with pasting content into product card descriptions
  • Now properly strips header formatting when pasting into product descriptions

Other Fixes

  • Staff invites now use the inviting user's email as the reply-to address
  • Removed outdated subscriber-related webhook fixtures
  • Cleaned up snapshot files for removed or renamed tests

New Features

Dynamic Routing Improvements

  • Pages can now be used as posts in dynamic routing
  • Both .page and .post properties work for pages in routing, providing backward compatibility
  • Solves issues #10042 and #14206

Enhanced Image Handling

  • Added support for changing image formats via the handle-image-sizes middleware
  • New URL pattern for format conversion: /content/images/size/w256h256/format/webp/2022/05/image.gif
  • Animations are preserved when converting GIFs to WebP and vice versa
  • Supports format conversion between various image types

Expanded Favicon Support

  • Added support for more image formats as favicons: .jpg, .jpeg, .gif, .webp, and .svg
  • Non-square favicons are automatically cropped
  • Larger images (>1000px) are automatically resized to 256x256px
  • Increased file size limits (up to 20MB for images, 200KB for .ico files)
  • SVG files no longer require minimum dimensions
  • Non-compatible formats are automatically converted to PNG for browser compatibility

Security Updates

No specific security fixes were mentioned in this release.

Performance Improvements

Image Processing Optimizations

  • Image formatting and resizing system now more efficiently handles various image types
  • Processed images are stored to avoid resizing on every request
  • Improved handling of large image files with automatic resizing

Code Cleanup

  • Removed unused getNewsletterRelations method
  • Removed completed TODOs from the codebase
  • Cleaned up snapshot files for better test performance
  • Removed outdated documentation and references to single author concept

Impact Summary

Ghost 5.1.0 delivers significant improvements to content flexibility and image handling. The ability to use pages as posts in dynamic routing solves a long-standing limitation, giving developers more options for organizing content. The expanded favicon support and new image formatting capabilities provide greater flexibility for site customization and optimization.

For content creators working with RTL languages, the fixed reading time calculation ensures more accurate estimates for their audience. Site administrators benefit from less restrictive requirements for favicons, supporting more image formats and sizes.

This release focuses on quality-of-life improvements rather than major new features, addressing specific pain points reported by the community. The changes to dynamic routing and image handling in particular demonstrate Ghost's commitment to providing flexible tools for modern publishing while maintaining backward compatibility.

Full Release Notes

  • ✨ Allowed page to be used as post in dynamic routing - Hannah Wolfe
  • 🎨 Updated Casper to v5.1.1 - Sodbileg Gansukh
  • 🎨 Reduced favicon requirements and added image formatting - Simon Backx
  • 🐛 Fixed reading time for RTL languages - Hannah Wolfe
  • 🐛 Fixed pasting into product card descriptions not stripping header formatting - Kevin Ansfield
  • 🐛 Fixed gscan not detecting issues in folders - Hannah Wolfe

View the changelogs for full details:

🪄 Love open source? We're hiring Node.js Engineers to work on Ghost full-time

Statistics:

File Changed52
Line Additions1,506
Line Deletions3,347
Line Changes4,853
Total Commits18

User Affected:

  • Can now use pages as posts in dynamic routing, providing more flexibility in content organization
  • Have access to expanded image formatting options via the `handle-image-sizes` middleware
  • Can work with more image formats for favicons with less restrictive requirements

Contributors:

matthanleyrenovate-botnazSimonBackxErisDSdaniellockyer