@plugdash/readtime

The EmDash alternative to Reading Time WP

Tell readers what they're committing to.

320 words·2min read

Estimates reading time from your post's word count and shows it wherever you want. Works on every published post, automatically. Nothing to configure to ship something good.

npm install @plugdash/readtime
betaGitHub
5min read5min read5min read5min read

Every variant. The first is the default, no configuration.

Setup

  1. Install and register

    bash
    npm install @plugdash/readtime
    js
    import readtime from "@plugdash/readtime"
    // in emdash plugins array:
    readtime({ collections: ["blog"] })
  2. Add to your layout

    astro
    import ReadingTime from "@plugdash/readtime/ReadingTime.astro"
    
    <ReadingTime post={post} />

After this, every published post shows reading time. If a post doesn't have it yet, publish it again - readtime runs on every publish.

It looks right. But it's yours to change.

Props

proptypedefaultdescription
postEmDash content itemRequired - the post
variant"badge" | "pill" | "inline" | "minimal""badge"Visual style
size"sm" | "md" | "lg""md"Size scale
labelstring"min read"Text after the number
showWordsbooleanfalseAlso show word count

CSS custom properties

tokendescription
--plugdash-rt-colorText colour
--plugdash-rt-sizeFont size
--plugdash-rt-bgBackground (badge/pill only)
--plugdash-rt-borderBorder colour (badge only)
--plugdash-rt-radiusBorder radius (badge/pill)
--plugdash-rt-paddingPadding (badge/pill)

Components are intentionally simple. Copy src/ReadingTime.astrointo your theme and modify freely - no upstream coupling.

Pairs well with

readers who finish a post are your most likely to share or heart it. Show them the path.

alpha

The simplest signal readers can send. Show them you counted it.

npm install @plugdash/heartpost
beta

Readers who want to share your work shouldn't have to work for it.

npm install @plugdash/sharepost
built with plugdash.dev