Home

>

Tools

>

Ghost

>

Releases

>

4.0.0

Ghost Release: 4.0.0

Tag Name: v4.0.0

Release Date: 3/15/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 4.0 introduces significant changes to the platform, focusing on enhancing the member experience and modernizing the codebase. Members and Portal features are now enabled by default, with a new paywall card to mark premium content boundaries. The update adds support for 113 new currencies, native lazy loading for images, and a customizable accent color system. The release also includes major architectural improvements with a new boot process, improved URL handling, and better performance. This is a major version update with breaking changes that require careful migration planning.

Highlight of the Release

    • Members and Portal features are now enabled by default
    • Added paywall card to mark end of free content preview
    • Support for 113 new currencies
    • Native lazy loading for content images
    • Added accent color CSS variable to customize site appearance
    • New boot process for improved performance
    • Comes with Casper 4.0 theme

Migration Guide

Before Upgrading

  1. Read the breaking changes guide: Visit https://ghost.org/docs/changes/ for detailed information on breaking changes.
  2. Update Ghost-CLI: Ghost 4.0 requires Ghost-CLI version 1.16.0 or higher. Update with npm install -g ghost-cli@latest.
  3. Backup your site: Always create a complete backup before upgrading to a major version.

Theme Compatibility

Ghost 4.0 comes with Casper 4.0, which includes significant changes. If you're using a custom theme:

  1. Check theme compatibility with GScan to identify any deprecated helpers or features.
  2. Update any usage of deprecated helpers:
    • Replace {{@labs.members}} with direct member features
    • Update {{currency_symbol}} to use the new {{price}} helper
    • Replace {{default_payment_card_last4}} with {{last4}}
    • Update {{@site.lang}} to {{@site.locale}}

API Changes

If you're using the Ghost API in custom code:

  1. Update API version references from v3 to v4
  2. Note that the "unsplash" setting is now a boolean value in v4 (previously an object)
  3. Members subscriptions data structure has been flattened in the API

Database Changes

  1. Apps-related tables have been dropped
  2. Foreign key checks are now enabled on SQLite3
  3. URL storage format has changed to use __GHOST_URL__ placeholder

Configuration Updates

  1. Labs settings have been removed - features previously behind labs flags are now enabled by default
  2. The private mode cookie has been renamed

Upgrade Recommendations

Who should upgrade immediately:

  • Sites looking to leverage the new membership features and Portal interface
  • Publishers wanting to use the new paywall card for premium content
  • Sites needing support for additional currencies
  • Developers wanting to take advantage of the new boot process and performance improvements

Who should wait:

  • Sites with heavily customized themes that haven't been tested with Ghost 4.0
  • Sites using custom integrations with the Ghost API that may need updates
  • Production sites that cannot afford downtime without thorough testing

Upgrade path:

  1. Test the upgrade on a staging environment first
  2. Ensure your theme is compatible with Ghost 4.0 or update to Casper 4.0
  3. Update Ghost-CLI to version 1.16.0 or higher
  4. Create a complete backup of your site
  5. Run ghost update major to perform the upgrade

For sites with custom themes or integrations, plan for additional development time to address any compatibility issues.

Bug Fixes

Fixed Complimentary Members' Content Gating

Resolved an issue where members on complimentary plans couldn't access paid-member content. The content gating system now properly recognizes comped members.

Fixed Image and Gallery Cards Attributes

Fixed an issue where image and gallery cards weren't receiving proper srcset or sizes attributes, which affected responsive image behavior.

Fixed Theme Installation Error

Resolved an issue where theme installation could delete the active theme if an error occurred during the process.

Fixed Unexpected Members-Only Content in Excerpts

Fixed a bug where members-only content was unexpectedly appearing in post excerpts.

Fixed Portal Not Appearing on 404 Pages

Corrected an issue where the Portal interface wasn't appearing on 404 pages.

Fixed ENOTFOUND Error Handling

Improved error handling for ENOTFOUND errors on NodeJS versions 13 and above.

Fixed Settings Images URLs

Resolved an issue with settings images (cover_image, logo, etc.) having incorrect URLs after the URL storage format change.

New Features

Members and Portal Enabled by Default

Ghost's membership features and Portal interface are now enabled by default, making it easier for publishers to start building their audience immediately without additional configuration.

Paywall Card

A new paywall card has been added to clearly mark the boundary between free and premium content. This allows content creators to precisely control what portion of their posts is available as a preview to non-members.

Support for 113 New Currencies

Ghost now supports 113 additional currencies for memberships and subscriptions, greatly expanding monetization options for international publishers.

Native Lazy Loading for Images

Content images now include native lazy loading attributes, improving page load performance without requiring additional plugins or custom code.

Image Cards as Links

Image cards can now be made into clickable links, enhancing content interactivity and providing more flexibility in content design.

Accent Color Customization

Added an accent color CSS variable to {{ghost_head}}, allowing for consistent brand colors across themes. The accent color is exposed as --ghost-accent-color for easy theme customization.

Theme Preview Mode

A new theme preview mode has been added, making it easier to test theme changes before publishing them to your site.

YAML File Support for Redirects

Ghost now supports YAML files for managing redirects, providing a more flexible and maintainable way to handle URL redirections.

New Members Stats Endpoints

New API endpoints for member statistics provide better insights into member activity and subscription performance.

Security Updates

Enabled Foreign Key Checks on SQLite3

Foreign key checks are now enabled on SQLite3 databases, improving data integrity and preventing orphaned records.

Added Foreign Keys to Several Tables

Added proper foreign key constraints to several tables, ensuring referential integrity and preventing data corruption.

Fixed Circular Dependency Warning

Resolved a circular dependency issue in the proxy service that could potentially lead to security vulnerabilities.

Performance Improvements

New Boot Process

Ghost 4.0 introduces a completely redesigned boot process that improves startup time and resource utilization.

Changed Internal URL Storage Format

URLs are now stored internally using a __GHOST_URL__ placeholder, which significantly improves performance when transforming content for output and makes it easier to change site URLs or subdirectories.

Native Lazy Loading for Images

The addition of native lazy loading attributes to content images improves page load performance by deferring off-screen image loading.

Removed Database Queries Against information_schema

Migration performance has been improved by removing queries against the information_schema, which could be slow on systems with many databases.

SQLite Path Optimization for Tests

Changed the database path for SQLite tests to use memory storage, resulting in significantly faster test execution.

Job Scheduling Improvements

Worker message handling has been improved to reduce file handle leaks, addressing performance issues with background jobs.

Impact Summary

Ghost 4.0 represents a significant evolution of the platform with a focus on membership features, performance improvements, and modernizing the codebase. The most impactful changes include:

  1. Membership-first approach: With Members and Portal enabled by default, Ghost is now positioned as a membership platform out of the box, making it easier for publishers to build direct relationships with their audience.

  2. Content monetization improvements: The new paywall card, support for 113 additional currencies, and improved member statistics provide powerful tools for publishers looking to monetize their content.

  3. Performance enhancements: The new boot process, native lazy loading for images, and improved URL handling contribute to better site performance and user experience.

  4. Developer experience: Major architectural changes like the new URL storage format, foreign key enforcement, and removal of deprecated features create a more robust foundation for future development.

  5. Breaking changes: As a major version update, Ghost 4.0 includes breaking changes that require careful migration planning, particularly for sites with custom themes or integrations.

This release aligns with Ghost's strategic direction as a professional publishing platform with built-in business tools, while also addressing technical debt and improving the foundation for future development.

Full Release Notes

➡️ For an overview of changes see the 4.0 Changelog
⚠️ Before updating please read the breaking changes guide


  • ✨ Members and Portal are enabled by default
  • ✨ Added support for 113 new currencies (TryGhost/Admin#1853) - Fabien 'egg' O'Carroll
  • ✨ Added native lazy loading behaviour to content images - Kevin Ansfield
  • ✨ Added paywall card to mark end of free content preview (#12663) - Kevin Ansfield
  • ✨ Added ability to make image cards links - Kevin Ansfield
  • ✨ Added accent color CSS variable to {{ghost_head}} (#12717) - Kevin Ansfield
  • ✨ Added new boot process - Hannah Wolfe
  • ✨ Added new members stats endpoints - Rishabh Garg
  • ✨ Added theme preview mode - Hannah Wolfe
  • ✨ Added YAML file support for redirects - Kukhyeon Heo
  • 🏗 Flattened members subscriptions data in API - Rishabh Garg
  • 🏗 Dropped apps related tables - Naz G
  • 🏗 Removed labs from settings - Naz G
  • 💡 Enabled foreign key checks on sqlite3 - Thibaut Patel
  • 💡 Removed main script that no longer exists - Hannah Wolfe
  • 💡 Resolved orphaned webhooks - Thibaut Patel
  • 💡 Renamed the private mode cookie - Thibaut Patel
  • ⚙️ Bumped required Ghost-CLI version to 1.16.0 - Daniel Lockyer
  • 🎨 Comes with Casper 4.0

View the changelogs for full details:

Statistics:

File Changed300
Line Additions12,122
Line Deletions2,942
Line Changes15,064
Total Commits250

User Affected:

  • Members and Portal features are now enabled by default, providing immediate access to membership functionality
  • Support for 113 new currencies allows for more flexible monetization options
  • New members stats endpoints provide better insights into member activity
  • Breaking changes require careful migration planning and possibly theme updates

Contributors:

allouisnazkevinansfieldErisDSrenovate[bot]rshbhgrgdaniellockyertpatelrenovate-botsam-lordpeterzimonJohnONolanmatthanley