From 9c5cc49aa0f269dafe154358ee23b27e8dce1d86 Mon Sep 17 00:00:00 2001 From: Yasutake Yohei <61961825+yasutakeyohei@users.noreply.github.com> Date: Thu, 25 Jun 2026 00:05:55 +0900 Subject: CGitのソーシャルアイコンをカスタム fork/branch SVG に変更 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit SocialIcons コンポーネントを上書きして、CGit 用に git リポジトリを表す fork/branch アイコンを表示。 - src/components/starlight/SocialIcons.astro を新規作成 - Starlight の social icon はカスタム SVG を受け付けないため、 コンポーネント上書きで対応 - X アイコンも併せてインライン化 --- src/components/starlight/SocialIcons.astro | 51 ++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/components/starlight/SocialIcons.astro (limited to 'src/components') diff --git a/src/components/starlight/SocialIcons.astro b/src/components/starlight/SocialIcons.astro new file mode 100644 index 0000000..4cceb9a --- /dev/null +++ b/src/components/starlight/SocialIcons.astro @@ -0,0 +1,51 @@ +--- +import config from "virtual:starlight/user-config"; + +const links = config.social || []; + +// Built-in SVG icons (replacing Starlight's Icon component for social links) +const BUILTIN: Record = { + "x.com": + '', + "code-branch": + '', +}; + +// CGit 専用アイコン(cgit.yasutakeyohei.com の favicon に基づく) +const CGIT_SVG = + ''; +--- + +{ + links.length > 0 && ( + <> + {links.map(({ label, href, icon }) => { + const svg = label === "CGit" ? CGIT_SVG : (BUILTIN[String(icon)] || BUILTIN["code-branch"]); + return ( + + {label} + + ); + })} + + ) +} + + -- cgit v1.3.1