From b3c30e3029922fc77721fa69baa6b1bac72293da Mon Sep 17 00:00:00 2001 From: Ricardo Date: Thu, 29 Jan 2026 22:42:49 +0100 Subject: [PATCH] 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 --- _data/site.js | 17 ++++++++++++++++- _includes/layouts/base.njk | 8 +++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/_data/site.js b/_data/site.js index 0f4b389..56b3522 100644 --- a/_data/site.js +++ b/_data/site.js @@ -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(), }; diff --git a/_includes/layouts/base.njk b/_includes/layouts/base.njk index d69d58a..a1c4a0d 100644 --- a/_includes/layouts/base.njk +++ b/_includes/layouts/base.njk @@ -68,9 +68,15 @@ + {# Fediverse creator meta tag for Mastodon verification #} + {% if site.fediverseCreator %} + + {% endif %} + {# IndieAuth rel="me" links for identity verification #} + {# Note: Bluesky links use "me atproto" for verification #} {% for social in site.social %} - + {% endfor %}