aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-06-25 00:29:12 +0900
committerYasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com>2026-06-25 00:29:12 +0900
commit11420afc4486802bbf76e1617548f20656fbeb6d (patch)
treecf9eab3881e46a093eefd51443494ceba2115c8a
parent4b4b58f9cd435e38ccba59dbb1e7228841605f37 (diff)
CGit と X 両方のソーシャルアイコンを適切に修正
X アイコンが code-branch になっていたバグを修正し、 X は X ロゴ SVG に。CGit は Git fork/branch アイコンに。
-rw-r--r--src/components/starlight/SocialIcons.astro23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/components/starlight/SocialIcons.astro b/src/components/starlight/SocialIcons.astro
index dbb863e..334c9e4 100644
--- a/src/components/starlight/SocialIcons.astro
+++ b/src/components/starlight/SocialIcons.astro
@@ -10,21 +10,24 @@ const BUILTIN: Record<string, string> = {
"code-branch":
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="6" cy="6" r="2.5"/><circle cx="6" cy="18" r="2.5"/><line x1="6" y1="8.5" x2="6" y2="15.5"/><path d="M6 12 L18 8"/><circle cx="18" cy="6" r="2.5"/></svg>',
};
+
+// CGit: Git リポジトリの fork/branch アイコン
+const CGIT_SVG =
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="7" cy="7" r="3"/><circle cx="7" cy="17" r="3"/><line x1="7" y1="10" x2="7" y2="14"/><path d="M7 12h6a3 3 0 0 0 3-3V7"/><circle cx="17" cy="7" r="3"/></svg>';
---
{
links.length > 0 && (
<>
- {links.map(({ label, href }) => (
+ {links.map(({ label, href, icon }) => {
+ const svg = label === "CGit" ? CGIT_SVG : (BUILTIN[String(icon)] || "");
+ return (
<a href={href} rel="me" class="sl-flex" title={label}>
<span class="sr-only">{label}</span>
- {label === "CGit" ? (
- <span class="sl-social-text">cgit</span>
- ) : (
- <span class="sl-social-icon" set:html={BUILTIN["code-branch"]} />
- )}
+ {svg && <span class="sl-social-icon" set:html={svg} />}
</a>
- ))}
+ );
+ })}
</>
)
}
@@ -44,11 +47,5 @@ const BUILTIN: Record<string, string> = {
height: 1rem;
display: block;
}
- .sl-social-text {
- font-size: 0.8rem;
- font-weight: 700;
- line-height: 1;
- font-family: var(--__sl-font-mono, monospace);
- }
}
</style>