Revert "fix(site): normalize malformed SITE_SOCIAL input"

This reverts commit 435be45517.
This commit is contained in:
svemagie
2026-03-08 14:35:30 +01:00
parent 435be45517
commit f65a4148e6

View File

@@ -8,30 +8,12 @@
// Parse social links from env (format: "name|url|icon,name|url|icon")
function parseSocialLinks(envVar) {
if (!envVar) return [];
// Normalize common secret copy/paste mistakes, e.g. SITE_SOCIAL="..."
const cleaned = String(envVar)
.trim()
.replace(/^SITE_SOCIAL\s*=\s*/i, "")
.replace(/^['"]|['"]$/g, "");
return cleaned
.split(",")
.map((link) => link.trim())
.filter(Boolean)
.map((link) => {
const [rawName, rawUrl, rawIcon] = link.split("|");
const name = (rawName || "").trim().replace(/^['"]|['"]$/g, "");
const url = (rawUrl || "").trim().replace(/^['"]|['"]$/g, "");
const icon = (rawIcon || "").trim().replace(/^['"]|['"]$/g, "");
if (!name || !url) return null;
// Bluesky requires "me atproto" for verification
const rel = url.includes("bsky.app") ? "me atproto" : "me";
return { name, url, rel, icon: icon || name.toLowerCase() };
})
.filter(Boolean);
return envVar.split(",").map((link) => {
const [name, url, icon] = link.split("|").map((s) => s.trim());
// Bluesky requires "me atproto" for verification
const rel = url.includes("bsky.app") ? "me atproto" : "me";
return { name, url, rel, icon: icon || name.toLowerCase() };
});
}
// Get fediverse handle for fediverse:creator meta tag