diff options
| author | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-06-26 00:14:03 +0900 |
|---|---|---|
| committer | Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> | 2026-06-26 00:14:03 +0900 |
| commit | da0d8de221538a92276b5ff98b8f081a15ed9761 (patch) | |
| tree | c8045fb6738573ebfee102d7c4c02b15e158c0f5 | |
| parent | 2b2cae43e5940adf542c538d91b80e11b16fd069 (diff) | |
Xシェア時に「ページタイトル | 小平市議 安竹洋平」を本文に追加
| -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>', }, { |
