module.exports = { onPostLoad({ post }) { const wordCount = (post.rawContent || '').trim().split(/\s+/).length; // Assume average 200 words per minute const minutes = Math.max(1, Math.round(wordCount / 200)); post.readingTime = `${minutes} min read`; post.wordCount = wordCount; }, injectPostEnd({ post }) { if (post && post.readingTime) { return `
Article statistics: ~${post.wordCount} words • ${post.readingTime}
`; } return ''; } };