Package: social
Generates share links for social platforms — Facebook, X/Twitter, LinkedIn, Reddit, email, WhatsApp, Telegram, and 30+ more. Externalized from the website codebase in v0.40 so multiple apps can share the same implementation.
Repository: https://github.com/dracory/social
Installation
go get github.com/dracory/social
Usage
package main
import (
"fmt"
"github.com/dracory/social"
)
func main() {
url := social.ShareURL(social.PLATFORM_TWITTER, "https://example.com/post", "My post title")
fmt.Println(url)
}
Features
- Share URL builders for 30+ platforms.
- Title/URL parameters properly escaped.
- Used on public content pages to render share buttons.