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 .…