diff options
Diffstat (limited to 'src/components/SocialShare.astro')
| -rw-r--r-- | src/components/SocialShare.astro | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/components/SocialShare.astro b/src/components/SocialShare.astro index bb6c04f..f3be8e8 100644 --- a/src/components/SocialShare.astro +++ b/src/components/SocialShare.astro @@ -12,11 +12,16 @@ const pageTitle = title ?? ""; const encodedUrl = encodeURIComponent(pageUrl); const encodedTitle = encodeURIComponent(pageTitle); +const siteCredits = encodeURIComponent("小平市議 安竹洋平"); + +const xText = encodedTitle + ? `${encodedTitle}%20%7C%20${siteCredits}` + : siteCredits; const SHARE_LINKS = [ { label: "X", - href: `https://x.com/intent/tweet?url=${encodedUrl}&text=${encodedTitle}`, + href: `https://x.com/intent/tweet?url=${encodedUrl}&text=${xText}`, svg: '<svg 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"><path d="M4 4l11.733 16h4.267l-11.733-16z"/><path d="M4 20l6.768-6.768m2.46-2.46L20 4"/></svg>', }, { |
