TL;DR
Ghost 2.19.3 is a maintenance release that fixes critical template errors and improves developer experience. This update resolves a 500 error that was incorrectly appearing instead of 404s for missing pages, fixes HTML-to-plaintext conversion issues, and adds member data to local template options. The update also includes improvements to theme middleware and development workflow.
Highlight of the Release
- Fixed 500 template error that was incorrectly appearing instead of 404s for missing pages and assets
- Added member data to local template options, accessible via
{{@member}} in themes
- Fixed HTML-to-plaintext conversion in the API
- Updated express-hbs to 1.1.0 with support for local template options
- Improved developer experience with fixed 'Building admin client' messages
Migration Guide
No migration steps are required for this release. This is a maintenance release that can be safely installed without any additional configuration or changes to your existing setup.
Upgrade Recommendations
This release contains important bug fixes that improve the stability of your Ghost installation, particularly for error handling and template rendering. We recommend all users upgrade to Ghost 2.19.3 at their earliest convenience, especially if you've experienced 500 errors on missing pages or issues with the admin client build process during development.
Bug Fixes
Fixed 500 Template Error
Fixed an issue where a 500 template error was occurring instead of the expected 404 for missing pages and assets. The bug was caused by undefined context when a page was missing, resulting in errors when context.includes() was called. This has been resolved by defaulting to an empty array when context is undefined.
Fixed HTML-to-Plaintext Conversion
Resolved an issue with HTML-to-plaintext conversion that was broken in a previous commit. The fix ensures proper conversion for Ghost's API, which only supports HTML input format for versions above v8.
Fixed Never-Ending "Building admin client" Messages
Fixed an issue where using grunt dev would show never-ending "Building admin client" messages. This was happening because ember-cli stopped outputting the "Build successful" text that Ghost was looking for as an indication of completion.
New Features
Member Data in Templates
Ghost now provides member data to templates via local template options. This allows theme developers to access the current member's information using the {{@member}} helper, enabling more personalized content experiences.
Local Template Options Support
This release includes an update to express-hbs to version 1.1.0, which adds support for local template options. This gives theme developers more flexibility when working with templates and context data.
Security Updates
No security fixes were included in this release.
Performance Improvements
Refactored Theme Middleware
The theme middleware module has been refactored for better maintainability and performance:
- Replaced
var with const for better memory management
- Removed the use of objects to hold functions
- Split
updateTemplateData into three functions with clear naming
- Improved code readability by removing layers of indentation
These changes make the code more maintainable and potentially improve performance through better memory usage patterns.
Impact Summary
Ghost 2.19.3 is primarily a bug fix and enhancement release that improves stability and developer experience. The most significant impact is the resolution of the 500 template error issue, which ensures users see proper 404 pages instead of server errors when accessing missing content.
For developers, the addition of member data to local template options provides new capabilities for creating personalized experiences, while the update to express-hbs 1.1.0 offers more flexibility with templates. The refactored theme middleware improves code quality and maintainability.
This release also includes updates to the Casper theme (to version 2.9.8) and Ghost-Admin (to version 2.19.3), ensuring all components of the Ghost ecosystem are in sync.
Full Release Notes
- 🐛 Fixed 500 template error occurring in place of a 404 for missing pages/assets (#10660) - Fabien O'Carroll
- 🐛 Fixed confusing messaging around
.yml extension being allowed for routes.yaml uploads (#1140) - Vikas Potluri
You can see the full change log for the details of every change included in this release.