sharepost
What it does
On every publish, generates share URLs for Twitter/X, LinkedIn, WhatsApp, Bluesky, and email and writes them topost.data.metadata.shareUrls. ShipsShareButtons.astro with four variants. No third-party JavaScript, no tracking.
Install
npm install @plugdash/sharepostRegister
Open astro.config.mjs at the root of your Astro project. Import the plugin at the top, then add it to the pluginsarray of the emdash() integration - the one that sits inside Astro's top-level integrations array:
import { defineConfig } from "astro/config"
import emdash from "emdash/astro"
import { sharepostPlugin } from "@plugdash/sharepost"
export default defineConfig({
integrations: [
emdash({
plugins: [
sharepostPlugin({ via: "abhinavs" }),
],
}),
],
})The via option is your Twitter/X handle (without the @). It appears in the pre-filled tweet text.
Add the component
---
import ShareButtons from "@plugdash/sharepost/ShareButtons.astro"
---
<ShareButtons post={post} />Live demo
Props
| prop | type | default | description |
|---|---|---|---|
post | EmDash content item | Required | |
variant | "circle" | "pill" | "inline" | "minimal" | "circle" | Visual style |
platforms | array | ["twitter","linkedin","bluesky"] | Which networks to show |
CSS custom properties
| token | description |
|---|---|
--plugdash-share-gap | Space between buttons |
--plugdash-share-padding | Button padding |
--plugdash-share-radius | Button radius |
For agents
After install, publish a post and verifypost.data.metadata.shareUrls is an object with one URL per configured platform. The share URLs are pre-filled with the post title and canonical URL - no browser-side share SDK needed.