From da0d8de221538a92276b5ff98b8f081a15ed9761 Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Fri, 26 Jun 2026 00:14:03 +0900 Subject: Xシェア時に「ページタイトル | 小平市議 安竹洋平」を本文に追加 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/SocialShare.astro | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/components/SocialShare.astro') 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: '', }, { -- cgit v1.3.1