fix(site): guard parseSocialLinks against malformed SITE_SOCIAL entries
Build & Deploy / build-and-deploy (push) Successful in 2m30s
Build & Deploy / build-and-deploy (push) Successful in 2m30s
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 <noreply@anthropic.com>
This commit is contained in:
+2
-2
@@ -14,10 +14,10 @@ function parseSocialLinks(envVar) {
|
|||||||
if (!envVar) return [];
|
if (!envVar) return [];
|
||||||
return envVar.split(",").map((link) => {
|
return envVar.split(",").map((link) => {
|
||||||
const [name, url, icon] = link.split("|").map((s) => s.trim());
|
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";
|
const rel = url.includes("bsky.app") ? "me atproto" : "me";
|
||||||
return { name, url, rel, icon: icon || name.toLowerCase() };
|
return { name, url, rel, icon: icon || name.toLowerCase() };
|
||||||
});
|
}).filter(Boolean);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get fediverse handle for fediverse:creator meta tag
|
// Get fediverse handle for fediverse:creator meta tag
|
||||||
|
|||||||
Reference in New Issue
Block a user