Home

>

Tools

>

Ghost

>

Releases

>

4.1.0

Ghost Release: 4.1.0

Tag Name: v4.1.0

Release Date: 3/18/2021

Ghost LogoGhost

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

TL;DR

Ghost v4.1.0: Bug Fixes and Improvements

This release focuses on fixing several critical bugs from v4.0.1, including issues with URL handling, member management, and template rendering. Key improvements include fixing __GHOST_URL__ appearing in sitemaps and excerpts, resolving member deletion problems, enhancing AMP validation, and updating the admin interface with a new logo. The release also removes a deprecated route and improves price helper functionality.

Highlight of the Release

    • Fixed __GHOST_URL__ appearing in sitemaps and generated excerpts
    • Fixed member deletion issues in SQLite databases after upgrading from v3
    • Improved AMP validation by properly handling accent color style tags
    • Enhanced @price template data to work correctly with the price helper
    • Updated admin interface with new Ghost logo

Migration Guide

Deprecated Routes Removed

The /redirects/json route has been removed in this release. If you were using this route in your custom code or integrations, you should update to use the following alternatives:

  • For retrieving redirects: GET /redirects/download
  • For uploading redirects: POST /redirects/upload

AMP Template Changes

If you're using AMP templates, you'll need to update them to use the new {{amp_style}} helper for injecting styles. The accent color style is no longer included in {{ghost_head}} (aliased as {{amp_ghost_head}}) when in an AMP context.

Example usage:

<style amp-custom>
    {{amp_style}}
    /* Your additional styles here */
</style>

Price Helper Usage

The @price template data now supports two usage patterns:

  1. Using with the price helper: {{price @price.monthly}}
  2. Direct usage (outputs dollar amount): {{@price.monthly}}

Both methods are supported for backward compatibility.

Upgrade Recommendations

This release contains important bug fixes for URL handling, member management, and template rendering. It's recommended that all Ghost users upgrade to v4.1.0, especially if you:

  • Use SQLite as your database and have upgraded from v3 to v4
  • Generate sitemaps for your site
  • Use AMP templates
  • Work with member management features
  • Use the price helper in your theme

The upgrade process should be straightforward with no major breaking changes except for the removal of the deprecated /redirects/json route. Make sure to back up your database before upgrading as a standard precaution.

Bug Fixes

  • URL Placeholder Issues: Fixed __GHOST_URL__ appearing in sitemaps and generated excerpts by refactoring URL transforms to take place at the model layer rather than the API serializer layer.

  • Member Management: Fixed an issue preventing members from being deleted after upgrading to v4 on SQLite from v3, by adding missing unique constraints needed for foreign key references.

  • Price Helper Compatibility: Fixed @price template data to work correctly with the price helper by updating the data object to expose the required amount & currency properties while maintaining backward compatibility.

  • AMP Validation: Fixed AMP validation warnings caused by accent color style tags by removing them from {{ghost_head}} in AMP context and providing a new {{amp_style}} helper.

  • Editor UI: Fixed link contrast issues in the editor when using very light or dark accent colors.

  • Member Deletion Flow: Improved the member deletion process to properly prompt for subscription cancellation.

  • Config Error Handling: Fixed an issue where Ghost was hiding configuration errors behind a crash by improving error logging.

  • Migration Typo: Fixed a typo in the migration to add backupContent permission.

New Features

  • New Admin Logo: The Ghost admin interface has been updated with the new orb logo, replacing the previous squircle design.

  • New AMP Style Helper: Added a new {{amp_style}} helper specifically for AMP templates that can be used to inject styles, including accent colors, in an AMP-compliant way.

  • CI Check for v3 Updates: Added a continuous integration check to test updates from v3 to ensure smooth upgrade paths now that v4 has been officially released.

Security Updates

No specific security fixes were included in this release.

Performance Improvements

  • URL Transformation: Refactored URL transforms to occur at the model layer rather than the API serializer layer, which provides a more consistent approach to URL handling throughout the application.

  • Model Dependency: Optimized the post serializer to properly use the model for accessing the full set of fields, particularly for cases like email-preview where the "plaintext" field might not be present in "attrs".

Impact Summary

Ghost v4.1.0 is primarily a bug fix release that addresses several important issues discovered after the v4.0.1 release. The most significant fixes resolve problems with URL placeholders appearing in sitemaps and excerpts, member deletion failures in SQLite databases, and AMP validation warnings.

The release also includes some visual improvements with the new Ghost logo in the admin interface and better link contrast in the editor. Theme developers will benefit from enhanced price helper functionality and the new AMP style helper.

The only breaking change is the removal of the deprecated /redirects/json route, which should only affect users who haven't yet migrated to the newer redirect endpoints.

Overall, this is a recommended update for all Ghost users that improves stability and fixes several user-facing issues without introducing significant changes to the core functionality.

Full Release Notes

  • 🐛 Fixed __GHOST_URL__ appearing in sitemaps (#12787) - Kevin Ansfield
  • 🐛 Fixed unable to delete member (#12784) - Rishabh Garg
  • 🐛 Fixed link contrast in editor with very light/dark accent colors (TryGhost/Admin#1870) - Kevin Ansfield
  • 🐛 Fixed @price template data to work with price helper (#12764) - Fabien 'egg' O'Carroll
  • 🐛 Fixed deleting members to prompt cancellation (TryGhost/Admin#1869) - Fabien 'egg' O'Carroll
  • 🐛 Fixed AMP validation warning from accent color style tag (#12771) - Kevin Ansfield
  • 🐛 Fixed GHOST_URL appearing in generated excerpts - Naz
  • 💥 Removed the /redirects/json route alias - Thibaut Patel

View the changelogs for full details:

Statistics:

File Changed92
Line Additions4,630
Line Deletions382
Line Changes5,012
Total Commits15

User Affected:

  • Can now successfully delete members without encountering database errors
  • Will need to update any code using the deprecated `/redirects/json` route to use the recommended alternatives
  • Will see the new Ghost logo in the admin interface

Contributors:

nazkevinansfielddaniellockyertpatelallouisErisDSrshbhgrgpeterzimon