Some blogs like to show an estimated reading time for each post. Marble provides these estimates inside the editor interface, but you can also display them on the frontend of your site.
To then use this function, simply pass in the HTML content of your post, and it will return the estimated reading time in minutes.
Copy
Ask AI
const readTime = calculateReadTime("<p>Your post content goes here...</p>");
You can then use that number to display the reading time on your post pages. Feel free to tweek the words-per-minute value to better suit your audience!