-
Notifications
You must be signed in to change notification settings - Fork 13
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
PrettyTime: Use for minute(s) read #288
Comments
PrettyTime won't help here... |
@melloware I don't remember where but I discussed this with @FroMage and @mkouba and there is something done in Renarde that we could move to Qute Web |
But those are like PrettyTime they are time "since" like "8 minutes ago" when we need "1 minute" or "4 minutes" to read an article. All those are based on calculating from a point in time. |
How do you estimate/determine the value for "1 minute" or "4 minutes"? Is it a duration or what exactly? |
its magic... public static Object readTime(Page page) {
final long count = numberOfWords(page.rawContent());
return Math.round((float) count / 200);
} |
This is an average formula based on word counts you can find more info on google. |
I see. But then you don't need any library, right? @TemplateExtension
public static String minutesRead(int minutes) {
return minutes <= 1 ? "1 minute" : (minutes + " minutes");
} And in the template something like |
Yep let me submit a PR |
Ahhh its in the UI code because of IL8N being able to customize it per language. I don't want to hard code "minute" in the template extension. |
We should make Minutes Read so its properly formatted using QuarkiVerse PrettyTime: https://github.com/quarkiverse/quarkus-prettytime
The text was updated successfully, but these errors were encountered: