From f60369d2c8774d85f73f49dd51a82e8046d9146c Mon Sep 17 00:00:00 2001 From: syui Date: Thu, 22 Jan 2026 22:23:14 +0900 Subject: [PATCH] fix at.link profile --- src/web/components/link.ts | 37 +++++++++++++++++++--- src/web/main.ts | 7 ++-- src/web/styles/main.css | 65 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 7 deletions(-) diff --git a/src/web/components/link.ts b/src/web/components/link.ts index ad2f61a..2434ac1 100644 --- a/src/web/components/link.ts +++ b/src/web/components/link.ts @@ -29,6 +29,37 @@ function buildUrl(service: string, username: string): string { return config.urlTemplate.replace('{username}', username) } +// Render compact link buttons for profile area +export function renderLinkButtons(data: LinkCollection | null): string { + if (!data || !data.links || data.links.length === 0) { + return '' + } + + const domainMap: Record = { + github: 'github.com', + x: 'x.com', + youtube: 'youtube.com', + } + + const buttons = data.links.map(link => { + const { service, username } = link + const config = serviceConfig[service as keyof typeof serviceConfig] + if (!config) return '' + + const url = buildUrl(service, username) + const domain = domainMap[service] || service + + return ` + + ${config.icon} + ${domain}/${username} + + ` + }).join('') + + return `` +} + // Render link item for display function renderLinkItem(link: LinkItem): string { const { service, username } = link @@ -99,8 +130,7 @@ export function renderLinkPage(data: LinkCollection | null, handle: string, isOw return `