aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/SocialShare.astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/components/SocialShare.astro')
-rw-r--r--src/components/SocialShare.astro11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/components/SocialShare.astro b/src/components/SocialShare.astro
index f3be8e8..a375884 100644
--- a/src/components/SocialShare.astro
+++ b/src/components/SocialShare.astro
@@ -2,7 +2,7 @@
export interface Props {
/** Page URL (defaults to current page) */
url?: string;
- /** Page title */
+ /** 共有時のキャプション(ページを表す文言) */
title?: string;
}
@@ -11,12 +11,11 @@ const pageUrl = url ?? Astro.url.href;
const pageTitle = title ?? "";
const encodedUrl = encodeURIComponent(pageUrl);
-const encodedTitle = encodeURIComponent(pageTitle);
-const siteCredits = encodeURIComponent("小平市議 安竹洋平");
+const siteCredits = "小平市議 安竹洋平";
-const xText = encodedTitle
- ? `${encodedTitle}%20%7C%20${siteCredits}`
- : siteCredits;
+const xText = encodeURIComponent(
+ pageTitle ? `${siteCredits} ${pageTitle}` : siteCredits,
+);
const SHARE_LINKS = [
{