-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
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
feat(v2): add blog post estimated reading time #2531
Conversation
Deploy preview for docusaurus-2 ready! Built with commit 27a5189 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @JoseRenan amazing work! ❤️ Just a detail, could you update the existing test with your new field?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Could you also document the new option in website/docs/using-plugins.md
for the blog plugin?
packages/docusaurus-theme-classic/src/theme/BlogPostItem/index.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
Motivation
Resolve #2467
As described in #2467, it's very common to see on blogs the estimated reading time of posts, so the purpose of this change is to add the estimated reading time of blog posts in docusaurus.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Go to the blog page and the estimated reading time will be there:
You can also set the prop
showReadingTime
to false on the blog section ofdocusaurus.config.js
and the reading time will not be shown anymoreObservations
reading-time
which is used by a similar plugin on gatsby to calculate the estimated reading time, but I think it can be calculated without a library 🤔