mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-04-02 16:44:56 +02:00
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:
@@ -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(),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user