mirror of
https://github.com/svemagie/blog-eleventy-indiekit.git
synced 2026-05-15 15:08:51 +02:00
feat: use AP handle as primary fediverse identity
Rename getMastodonHandle() to getFediverseCreator() and prefer the site's own ActivityPub handle (ACTIVITYPUB_HANDLE) over the external Mastodon account for the fediverse:creator meta tag. The Mastodon account is a syndication target, not the canonical identity.
This commit is contained in:
+12
-4
@@ -16,8 +16,16 @@ function parseSocialLinks(envVar) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get Mastodon handle for fediverse:creator meta tag
|
// Get fediverse handle for fediverse:creator meta tag
|
||||||
function getMastodonHandle() {
|
// Prefers the site's own ActivityPub identity over external Mastodon account
|
||||||
|
function getFediverseCreator() {
|
||||||
|
// Primary: site's own ActivityPub actor (canonical fediverse identity)
|
||||||
|
const apHandle = process.env.ACTIVITYPUB_HANDLE;
|
||||||
|
if (apHandle) {
|
||||||
|
const domain = (process.env.SITE_URL || "https://example.com").replace(/^https?:\/\//, "");
|
||||||
|
return `@${apHandle}@${domain}`;
|
||||||
|
}
|
||||||
|
// Fallback: external Mastodon account (syndication target)
|
||||||
const instance = process.env.MASTODON_INSTANCE?.replace("https://", "") || "";
|
const instance = process.env.MASTODON_INSTANCE?.replace("https://", "") || "";
|
||||||
const user = process.env.MASTODON_USER || "";
|
const user = process.env.MASTODON_USER || "";
|
||||||
if (instance && user) {
|
if (instance && user) {
|
||||||
@@ -104,8 +112,8 @@ export default {
|
|||||||
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)
|
// Fediverse creator for meta tag (e.g., @rick@rmendes.net)
|
||||||
fediverseCreator: getMastodonHandle(),
|
fediverseCreator: getFediverseCreator(),
|
||||||
|
|
||||||
// Support/monetization configuration (used in _textcasting JSON Feed extension)
|
// Support/monetization configuration (used in _textcasting JSON Feed extension)
|
||||||
support: {
|
support: {
|
||||||
|
|||||||
Reference in New Issue
Block a user