{{- $pageurl := .Permalink }} {{- $title := .Title }} {{- $desc := .Description }} {{- $.Scratch.Set "tags" ""}} {{- with .Params.Tags }} {{- $hashtags := newScratch}} {{- range . }}{{ $hashtags.Add "tags" (slice (replaceRE "(\\s)" "" . ))}}{{end}} {{- $.Scratch.Set "tags" (delimit ($hashtags.Get "tags") ",") }} {{- end -}} {{- $wc_tags := slice }} {{- range $.Page.GetTerms "tags" }}{{ $wc_tags = $wc_tags | append .LinkTitle }}{{ end }} {{- $wc_cats := slice }} {{- range $.Page.GetTerms "categories" }}{{ $wc_cats = $wc_cats | append .LinkTitle }}{{ end }} {{- $custom := false }} {{- $ShareButtons := (.Param "ShareButtons")}} {{- with $ShareButtons }}{{ $custom = true }}{{ end }} {{/* Build rich share text: title + description excerpt + URL */}} {{- $descShort := "" }} {{- if $desc }}{{- $descShort = $desc | truncate 120 "…" }}{{- end }} {{- $tagList := delimit $wc_tags " #" }} {{- $richText := $title }} {{- if $descShort }}{{- $richText = printf "%s\n\n%s" $richText $descShort }}{{- end }} {{- $richText = printf "%s\n\n%s" $richText $pageurl }} {{- if $wc_tags }}{{- $richText = printf "%s\n\n#%s" $richText $tagList }}{{- end }} {{/* Twitter tweet text: title + description excerpt */}} {{- $tweetText := $title }} {{- if $descShort }}{{- $tweetText = printf "%s — %s" $title $descShort }}{{- end }} {{/* Email body */}} {{- $emailBody := $title }} {{- if $descShort }}{{- $emailBody = printf "%s\n\n%s" $emailBody $descShort }}{{- end }} {{- $emailBody = printf "%s\n\n%s" $emailBody $pageurl }} {{- if $wc_cats }}{{- $emailBody = printf "%s\n\nTopics: %s" $emailBody (delimit $wc_cats ", ") }}{{- end }} {{- if $wc_tags }}{{- $emailBody = printf "%s\nTags: %s" $emailBody (delimit $wc_tags ", ") }}{{- end }}
{{ i18n "share_label" | default "Share this article" }}
{{/* ── Primary buttons (always visible) ── */}} {{/* ── Secondary buttons (expand on "more") ── */}}
{{/* Mobile bottom sheet */}}