Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Feature: {{reading_time}} theme helper #9217

Merged
merged 1 commit into from
Nov 6, 2017

Conversation

aileen
Copy link
Member

@aileen aileen commented Nov 6, 2017

closes #9200

  • Registered new server helper {{reading_time}}.
  • Added new global util word-count based on the util in Ghost admin, which returns the number of words in an HTML string.
  • Based on the word count of the post html, the helper calculated the estimated reading time:
    • 275 words per minute
    • additional 12 seconds when post has feature image
  • Renders a string like 'x min red', unless reading time is less than a minute. In this case, the rendered string is '< 1 min read'.

@aileen aileen force-pushed the reading-time branch 3 times, most recently from 030b30d to 048c984 Compare November 6, 2017 11:11
closes TryGhost#9200

- Registered new server helper `{{reading_time}}`.
- Added new global util `word-count` based on the util in Ghost admin, which returns the number of words in an HTML string.
- Based on the word count of the post html, the helper calculated the estimated reading time:
   - 275 words per minute
   - additional 12 seconds when post has feature image
- Renders a string like 'x min red', unless reading time is less than a minute. In this case, the rendered string is '< 1 min read'.
@aileen aileen changed the title [WIP] ✨ Reading time helper ✨ Reading time helper Nov 6, 2017
@aileen aileen requested a review from ErisDS November 6, 2017 11:19
@aileen
Copy link
Member Author

aileen commented Nov 6, 2017

Well, no styles, but this is how it looks like for the post index:

image

And for a post:

image

@aileen aileen changed the title ✨ Reading time helper ✨ Feature: {{reading_time}} theme helper Nov 6, 2017
@ErisDS ErisDS merged commit dbd22d7 into TryGhost:master Nov 6, 2017
@aileen aileen deleted the reading-time branch April 10, 2018 05:13
@ErisDS ErisDS removed their assignment Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reading time helper
2 participants