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 [];
|
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());
|
||||||
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
|
// Default social links if none configured
|
||||||
const defaultSocial = [
|
const defaultSocial = [
|
||||||
{
|
{
|
||||||
@@ -63,4 +75,7 @@ export default {
|
|||||||
webmentions: {
|
webmentions: {
|
||||||
domain: process.env.SITE_URL?.replace("https://", "").replace("http://", "") || "example.com",
|
domain: process.env.SITE_URL?.replace("https://", "").replace("http://", "") || "example.com",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Fediverse creator for meta tag (e.g., @rmdes@mstdn.social)
|
||||||
|
fediverseCreator: getMastodonHandle(),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -68,9 +68,15 @@
|
|||||||
<link rel="webmention" href="https://webmention.io/{{ site.webmentions.domain }}/webmention">
|
<link rel="webmention" href="https://webmention.io/{{ site.webmentions.domain }}/webmention">
|
||||||
<link rel="pingback" href="https://webmention.io/{{ site.webmentions.domain }}/xmlrpc">
|
<link rel="pingback" href="https://webmention.io/{{ site.webmentions.domain }}/xmlrpc">
|
||||||
|
|
||||||
|
{# Fediverse creator meta tag for Mastodon verification #}
|
||||||
|
{% if site.fediverseCreator %}
|
||||||
|
<meta name="fediverse:creator" content="{{ site.fediverseCreator }}">
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{# IndieAuth rel="me" links for identity verification #}
|
{# IndieAuth rel="me" links for identity verification #}
|
||||||
|
{# Note: Bluesky links use "me atproto" for verification #}
|
||||||
{% for social in site.social %}
|
{% for social in site.social %}
|
||||||
<link rel="me" href="{{ social.url }}">
|
<link rel="{{ social.rel }}" href="{{ social.url }}">
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|||||||
Reference in New Issue
Block a user