{{reading_time}} fails with an empty post

Issue Summary
It’s probably not an issue on a real blog but I discovered it while working on a theme. If a post is empty, the reading_time doesn’t output anything.

Steps to Reproduce

  1. Create a post with a title but no content.
  2. Open post

Setup information

Ghost Version
5.128.0

Node.js Version
v20.19.3

How did you install Ghost?
python venv, nodeenv, ghost install local

Provide details of your host & operating system
Local development, Ubuntu Linux in WSL

Database type
SQLite

The issue occurs because {{reading_time}} relies on post content to calculate reading duration, so with no content, it returns nothing. To fix this in your theme, wrap {{reading_time}} with a conditional check like {{#if content}} {{reading_time}} {{else}} 0 min read {{/if}} to ensure a fallback message appears when a post is empty.

1 Like

Well this is a nice workaround if it was a real problem, it’s a trivial bug in production I won’t have empty posts I just thought I’d report it.