feat: add proper rel=me atproto for Bluesky and fediverse:creator meta tag

- Bluesky URLs now get rel='me atproto' for verification
- Added fediverse:creator meta tag for Mastodon creator attribution
- Meta tag populated from MASTODON_INSTANCE and MASTODON_USER env vars
This commit is contained in:
Ricardo
2026-01-29 22:42:49 +01:00
parent 13f8876298
commit b3c30e3029
2 changed files with 23 additions and 2 deletions

View File

@@ -10,10 +10,22 @@ function parseSocialLinks(envVar) {
if (!envVar) return [];
return envVar.split(",").map((link) => {
const [name, url, icon] = link.split("|").map((s) => s.trim());
return { name, url, rel: "me", icon: icon || name.toLowerCase() };
// Bluesky requires "me atproto" for verification
const rel = url.includes("bsky.app") ? "me atproto" : "me";
return { name, url, rel, icon: icon || name.toLowerCase() };
});
}
// Get Mastodon handle for fediverse:creator meta tag
function getMastodonHandle() {
const instance = process.env.MASTODON_INSTANCE?.replace("https://", "") || "";
const user = process.env.MASTODON_USER || "";
if (instance && user) {
return `@${user}@${instance}`;
}
return "";
}
// Default social links if none configured
const defaultSocial = [
{
@@ -63,4 +75,7 @@ export default {
webmentions: {
domain: process.env.SITE_URL?.replace("https://", "").replace("http://", "") || "example.com",
},
// Fediverse creator for meta tag (e.g., @rmdes@mstdn.social)
fediverseCreator: getMastodonHandle(),
};