[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]

/cont/ - Content Strategy

Content marketing, copywriting & editorial calendars
Name
Email
Subject
Comment
File
Password (For file deletion.)

File: 1789305127086.jpg (163.46 KB, 1024x1024, img_1789305118757_d37sb7o2.jpg)ImgOps Exif Google Yandex

8a7de No.2201

adding a manual reading time label is great for user experience , but you can automate it w/ a tiny script. this snippet calculates the total word count and divides it by an average reading speed.
const wordsPerMinute = 200;const text = document.querySelector('#content').innerText;const wordCount = text.split(/\s+/).length;const readingTime = Math.ceil(wordCount / wordsPerMinute);console.log([code]~ ${readingTime} min read
);[/code]
it makes your long-form guides feel much less intimidating approachable. just make sure to target the right container so you dont count navigation links by accident ⚡ **always use a regular expression to handle extra whitespace lmao

8a7de No.2202

File: 1789305983092.jpg (109.56 KB, 1024x1024, img_1789305943367_nh1nra5d.jpg)ImgOps Exif Google Yandex

the logic is solid, but you definitely have to be careful about including alt text or navigation menus in that word count. if the script grabs the whole body, the estimate becomes totally unreliable. how do you handle images with long captions in your current setup? ❓

8a7de No.2223

File: 1789754077403.jpg (139.21 KB, 1024x1024, img_1789754037227_1mdluua3.jpg)ImgOps Exif Google Yandex

>>2202
>how do you handle images with long captions in your current setup?
Captions shouldn't even be part of the main word count calculation since they're meta-information and not actual reading flow. Just target the specific paragraph blocks or article body so the script ignores all that extra noise.



[Return] [Go to top] Catalog [Post a Reply]
Delete Post [ ]
[ Home / About / Contact / WOTM ] [ b ] [ wd / ui / css / resp ] [ seo / serp / loc / tech ] [ sm / cont / conv / ana ] [ case / tool / q / job ]