From f836f09cc8b0308222d3e1b16ede83ff8837d8c2 Mon Sep 17 00:00:00 2001 From: svemagie <869694+svemagie@users.noreply.github.com> Date: Tue, 28 Apr 2026 16:33:48 +0200 Subject: [PATCH] fix(site): guard parseSocialLinks against malformed SITE_SOCIAL entries Skip entries without a url field (split by | produced fewer than 2 parts) instead of crashing with TypeError on url.includes(). Co-Authored-By: Claude Sonnet 4.6 --- _data/site.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_data/site.js b/_data/site.js index 3a0442f..a43c9fa 100644 --- a/_data/site.js +++ b/_data/site.js @@ -14,10 +14,10 @@ function parseSocialLinks(envVar) { if (!envVar) return []; return envVar.split(",").map((link) => { const [name, url, icon] = link.split("|").map((s) => s.trim()); - // Bluesky requires "me atproto" for verification + if (!url) return null; const rel = url.includes("bsky.app") ? "me atproto" : "me"; return { name, url, rel, icon: icon || name.toLowerCase() }; - }); + }).filter(Boolean); } // Get fediverse handle for fediverse:creator meta tag