@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
beta GitHub
5min read 5min read 5min read 5min read

This is the default. No configuration.

Setup

  1. Install and register

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

    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
post EmDash content item Required - the post
variant "badge" | "pill" | "inline" | "minimal" "badge" Visual style
size "sm" | "md" | "lg" "md" Size scale
label string "min read" Text after the number
showWords boolean false Also show word count

CSS custom properties

tokendescription
--plugdash-rt-color Text colour
--plugdash-rt-size Font size
--plugdash-rt-bg Background (badge/pill only)
--plugdash-rt-border Border colour (badge only)
--plugdash-rt-radius Border radius (badge/pill)
--plugdash-rt-padding Padding (badge/pill)

Components are intentionally simple. Copy src/ReadingTime.astro into 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.

heartpost

alpha

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

npm install @plugdash/heartpost

sharepost

beta

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

npm install @plugdash/sharepost
built with plugdash