@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
alpha GitHub

This is the default. No configuration.

Setup

  1. Install and register

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

    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
post EmDash content item Required
variant "circle" | "pill" | "inline" "circle" Visual style

CSS custom properties

tokendescription
--plugdash-copy-color Icon colour
--plugdash-copy-size Button size

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

sharepost

beta

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

npm install @plugdash/sharepost

heartpost

alpha

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

npm install @plugdash/heartpost
built with plugdash