Get the FREE Ultimate OpenClaw Setup Guide →

social-share-generator

npx machina-cli add skill kostja94/marketing-skills/social-share --openclaw
Files (1)
SKILL.md
5.0 KB

Components: Social Share Buttons

Guides implementation of share buttons that let users share the current page (article, post, product) to social platforms. Distinct from social profile links (footer links to your brand's X, LinkedIn, etc.) — share buttons share this content.

When invoking: On first use, if helpful, open with 1–2 sentences on what this skill covers and why it matters, then provide the main output. On subsequent use or when the user asks to skip, go directly to the main output.

Scope

  • Share buttons: Share current page URL to X, LinkedIn, Facebook, WhatsApp, etc.
  • Not social profile links (e.g. "Follow us on X") — those live in footer/nav

Why It Matters

  • Websites with visible social share icons tend to see higher social engagement
  • Share buttons amplify reach; Open Graph and Twitter Cards control preview — see open-graph, twitter-cards

Placement (Article Pages)

Fewer, better-placed buttons outperform scattered placement. Research: removing 80% of buttons and repositioning the remaining 20% at high-emotion moments can 3× conversion on share actions.

PlacementBest ForNotes
After first paragraphMost articlesCatches speed-readers; visible early
Sticky sidebarLong-form (desktop)Always visible; consider hiding on mobile
Below title / heroShort postsHigh visibility
End of articleAllNatural completion point; pair with CTA
Mid-article (after key insight)Long contentPlace at friction points (after surprising stat, before CTA)

Avoid: Dozens of icons; every platform when audience uses 2–3. Choose 3–5 platforms that match your audience (e.g. B2B: X, LinkedIn; B2C: X, Facebook, WhatsApp).

Share URLs (Intent Links)

Use platform share/intent URLs so users share with one click:

PlatformShare URL pattern
X (Twitter)https://twitter.com/intent/tweet?url={url}&text={text}
LinkedInhttps://www.linkedin.com/sharing/share-offsite/?url={url}
Facebookhttps://www.facebook.com/sharer/sharer.php?u={url}
WhatsApphttps://wa.me/?text={url}%20{text}
Telegramhttps://t.me/share/url?url={url}&text={text}

Encode url and text with encodeURIComponent(). Use page title or a short pre-written message for textplatform-specific prompts with pre-written messages perform ~4× better than generic icons.

Platform Brand Guidelines (Icons)

Use official brand assets. Minimum sizes and color rules:

PlatformMin sizeColorsNotes
Facebook16pxBlue #1877F2 or monochromeNo rotation, animation without permission
X (Twitter)32pxBlack or white onlyUse current X logo, not deprecated bird
LinkedIn21px heightBlue #0A66C2 or monochromeUse "in" bug for icons
Instagram29×29pxBlack, white, or official gradientGlyph for social icons

Source icons from official brand resource centers. Outdated or non-compliant icons reduce perceived shareability.

Design & Technical

ItemGuideline
FormatSVG preferred (scalable, small); PNG/WebP with fallback
PerformanceLightweight; avoid heavy share plugins that slow LCP
Accessibilityaria-label="Share on X"; keyboard accessible
MobileTouch targets ≥44×44px; consider native share API (navigator.share) on mobile

Native Share API (Mobile)

On supported browsers, navigator.share lets users share via system dialog (includes more apps). Fallback to intent links when unsupported:

if (navigator.share) {
  navigator.share({ title, url, text }).catch(() => {});
} else {
  window.open(shareUrl, '_blank', 'noopener');
}

Output Format

  • Placement recommendation for page type
  • Platforms to include (3–5)
  • Share URL examples with placeholders
  • Icon guidelines (size, source)
  • Accessibility checklist

Related Skills

  • article-page-generator: Share buttons on article pages; placement after intro, end of article
  • blog-page-generator: Share buttons on blog index and post cards
  • open-graph: OG tags control share preview (og:image, og:title, etc.) — required for share buttons to show rich cards on Facebook, LinkedIn
  • twitter-cards: Twitter Cards control X preview — required for share buttons to show rich cards when shared to X
  • footer-generator: Footer has social profile links (Follow us); this skill is for share buttons (share this page)

Source

git clone https://github.com/kostja94/marketing-skills/blob/main/skills/components/social-share/SKILL.mdView on GitHub

Overview

This skill guides how to add, optimize, or audit share buttons that push the current page to platforms like X, LinkedIn, Facebook, and WhatsApp. It clarifies the distinction from social profile links and emphasizes placement, URL patterns, and accessibility to boost social engagement.

How This Skill Works

Implement platform-specific share URLs (intent links) or the Web Share API on mobile, encoding the URL and optional text with encodeURIComponent. Use SVG icons, accessible ARIA labels, and place buttons strategically (after the first paragraph, end of article, or sticky sidebar) to maximize clicks without clutter.

When to Use It

  • Adding or auditing share buttons on articles, posts, or product pages
  • Choosing 3–5 platforms aligned with your audience (e.g., X and LinkedIn for B2B; X, Facebook, WhatsApp for B2C)
  • Encoding URLs/text and using intent URLs for one-click sharing
  • Ensuring accessibility and performance (SVG icons, aria-labels, 44×44 touch targets)
  • Leveraging native share (navigator.share) on mobile and optimizing previews via Open Graph/Twitter Cards

Quick Start

  1. Step 1: Audit current share buttons and decide 3–5 target platforms based on audience
  2. Step 2: Implement share URLs with encodeURIComponent(url) and a platform-specific text, plus SVG icons
  3. Step 3: Add aria-labels, ensure 44×44 touch targets, and enable navigator.share as a mobile fallback

Best Practices

  • Limit to 3–5 platforms to avoid icon overload and improve conversion
  • Use platform share URLs with encodeURIComponent() for url and text parameters
  • Provide platform-specific pre-written text to improve engagement (~4× better than generic icons)
  • Use SVG icons and follow brand guidelines; avoid rotation or animation without permission
  • Ensure accessibility with aria-labels and consider navigator.share on mobile for a native experience

Example Use Cases

  • A news site simplifies from many icons to 3–5 focused icons (X, LinkedIn, WhatsApp) placed after the first paragraph
  • A blog uses platform-specific prompts and a short message to accompany the share action
  • An article page places share buttons at the end of the article with a clear CTA to amplify reach
  • An e‑commerce product page enables WhatsApp and Telegram sharing with the product title/text encoded in the share URL
  • Mobile users see a fallback to the Web Share API via navigator.share with a graceful fallback to share URLs

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers