Menu

Our article type says "keep it honest" above the reading time, and all eight of them are wrong in the same direction
📰

Our article type says "keep it honest" above the reading time, and all eight of them are wrong in the same direction

DEV Community: nextjs·Daniel Pertu·3 days ago
#nOIfJcUs
#devtonextjs#devto#dev#guides#words
Reading 0:00
15s threshold

The long-form pages on Notifio are data, not MDX. Each one is an object in a TypeScript file, and the type has a field for the reading time with a one line instruction above it:

/** Rough minutes, shown under the title. Keep it honest. */ readingMinutes : number ;

Enter fullscreen mode

Exit fullscreen mode

I wrote that comment. Then I typed the number in by hand eight times. This week I counted the words.

The audit

The content is structured, so counting is not an estimate. Every page is a title , a standfirst , an array of sections each with a heading and a body string array, optional points , an optional callout , plus faqs . Walk all of it, split on whitespace:

const words = ( a : Article ) => { let t = [ a . h1 , a . standfirst ] . join ( " " ) ; for ( const s of a . sections ) { t += " " + s . heading + " " + s . body . join ( " " ) ; if ( s . points ) for ( const p of s . points ) t += " " + p . title + " " + p . body ; if ( s . callout ) t += " " + s . callout . label + " " + s . callout .…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.