@plugdash/shortlink

The EmDash alternative to Pretty Links

Every post, one clean URL to copy.

320 words·2min read

Auto-generates short URLs for published posts, stored in Cloudflare KV. Ships CopyLink.astro with three variants - circle, pill, inline. Green check on copy, resets in two seconds.

npm install @plugdash/shortlink
alphaGitHub
circle
pill
ghost
inline

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

Setup

  1. Install and register

    bash
    npm install @plugdash/shortlink
    js
    import shortlink from "@plugdash/shortlink"
    // in emdash plugins array:
    shortlink({ autoCreate: true })
  2. Add to your layout

    astro
    import CopyLink from "@plugdash/shortlink/CopyLink.astro"
    
    <CopyLink post={post} />

After this, each published post gets a short URL automatically. The component copies it to the clipboard on click.

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

Props

proptypedefaultdescription
postEmDash content itemRequired
variant"circle" | "pill" | "inline""circle"Visual style

CSS custom properties

tokendescription
--plugdash-copy-colorIcon colour
--plugdash-copy-sizeButton size

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

Pairs well with

copy link sits naturally alongside share and heart. Most readers use one of the three.

beta

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

npm install @plugdash/sharepost
alpha

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

npm install @plugdash/heartpost
built with plugdash.dev