/anglesite:sharefrom anglesite
Adds a native share button using the Web Share API with clipboard fallback. No third-party widgets or tracking.
Ships in anglesite. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Add a share button that uses the Web Share API on supporting browsers (mobile Safari, Chrome, Edge) and falls back to copy-to-clipboard on desktop. No third-party share widgets, no social media SDK embeds, no tracking pixels — just the platform's native share sheet.
Read EXPLAIN_STEPS from .site-config. If true or not set, explain before every tool call that will trigger a permission prompt. If false, proceed without pre-announcing.
Read .site-config for SHARE_ENABLED. If it's already true, tell the owner: "Share buttons are already set up. Would you like to change where they appear, update the style, or remove them?" Then adjust as needed.
Ask the owner:
"Where should the share button appear?
- Blog posts only — at the end of each post
- All pages — in the footer of every page
- Specific pages — you tell me which ones"
Option 1 is the most common choice. For blogs, the share button naturally follows the content.
Create src/components/ShareButton.astro:
---
interface Props {
title: string;
text?: string;
url?: string;
}
const { title, text, url } = Astro.props;
const shareUrl = url ?? Astro.url.pathname;
---
<div class="share-container">
<button
class="share-button"
type="button"
data-title={title}
data-text={text}
data-url={shareUrl}
>
<svg class="share-icon" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/><polyline points="16 6 12 2 8 6"/><line x1="12" y1="2" x2="12" y2="15"/></svg>
Share
</button>
<span class="share-toast" hidden aria-live="polite">Link copied</span>
</div>
<style>
.share-container {
display: inline-flex;
align-items: center;
gap: var(--space-sm);
position: relative;
}
.share-button {
display: inline-flex;
align-items: center;
gap: var(--space-xs);
padding: var(--space-xs) var(--space-sm);
background: var(--color-surface);
color: var(--color-text);
border: 1px solid var(--color-border);
border-radius: var(--radius-sm);
cursor: pointer;
font: inherit;
font-size: var(--font-size-sm);
transition: background-color 0.15s;
}
.share-button:hover {
background: var(--color-border);
}
.share-button:focus-visible {
outline: 2px solid var(--color-primary);
outline-offset: 2px;
}
.share-icon {
flex-shrink: 0;
}
.share-toast {
font-size: var(--font-size-sm);
color: var(--color-muted);
}
@media (prefers-reduced-motion: reduce) {
.share-button { transition: none; }
}
</style>
<script is:inline>
document.addEventListener("click", function (e) {
var btn = e.target.closest(".share-button");
if (!btn) return;
var title = btn.dataset.title || document.title;
var text = btn.dataset.text || "";
var url = new URL(btn.dataset.url || location.pathname, location.origin).href;
var toast = btn.parentElement.querySelector(".share-toast");
if (navigator.share) {
var data = { title: title, url: url };
if (text) data.text = text;
navigator.share(data).catch(function (err) {
if (err.name !== "AbortError") console.error(err);
});
} else if (navigator.clipboard) {
navigator.clipboard.writeText(url).then(function () {
if (!toast) return;
toast.hidden = false;
setTimeout(function () { toast.hidden = true; }, 2000);
});
}
});
</script>
Component design notes:
aria-live="polite" on the toast so screen readers announce "Link copied" without interrupting.aria-hidden="true" attribute prevents screen readers from announcing it (the button text "Share" is sufficient).For blog posts (option 1):
The blog post template is src/pages/blog/[slug].astro. If the site has moved it, find it with Glob (src/pages/**/*slug*.astro).
Read the file. Add the ShareButton import and render it after the post content, before the closing layout tag:
import ShareButton from "../../components/ShareButton.astro";
<ShareButton title={post.data.title} text={post.data.description ?? ""} />
post is the variable the shipped template uses (const { post } = Astro.props;). If the file names it differently, use that name instead.
Place it after the post body and any existing metadata (date, tags, author). If there's a post footer section, add it there. If not, wrap it in a <footer> with a class:
<footer class="post-footer">
<ShareButton title={post.data.title} text={post.data.description ?? ""} />
</footer>
Add minimal styling for the post footer:
.post-footer {
margin-block-start: var(--space-lg);
padding-block-start: var(--space-md);
border-block-start: 1px solid var(--color-border);
}
For all pages (option 2):
Add the ShareButton to src/layouts/BaseLayout.astro, in the <footer> element:
import ShareButton from "../components/ShareButton.astro";
<footer>
<ShareButton title={title} />
<!-- existing footer content -->
</footer>
For specific pages (option 3):
Add the import and component to each page the owner specified. Use the page's title prop.
Add to .site-config with the Edit tool:
SHARE_ENABLED=true
SHARE_PLACEMENT=<blog|all|specific>
Run npm run build.
After a successful build, tell the owner:
"Share buttons are live! Here's how they work:
- On mobile (iOS Safari, Android Chrome): tapping Share opens the device's native share sheet — visitors can send the page via Messages, WhatsApp, email, or any app they have installed
- On desktop: tapping Share copies the page link to the clipboard with a 'Link copied' confirmation
No data is sent to any third party. The button uses the browser's built-in Web Share API."
If /anglesite:share runs on a site that already has share buttons:
.site-config for SHARE_ENABLED and SHARE_PLACEMENTShareButton import and usage from the pages and layout, and set SHARE_ENABLED=false. Leave src/components/ShareButton.astro in place — an unused component adds nothing to the built siteWhat SKILL.md sets; muted values are Claude Code's defaults
Use when the owner wants visitors to easily share pages or posts from their phone without third-party share widgets.
Three short reads, in order
npx claudepluginhub anglesite/anglesite-skills --plugin anglesite56 skills in this plugin
/bookingEmbed appointment scheduling (Cal.com or Calendly) into the siteOther plugins' skills for the same job