From 90ff9068a108582e5a01dc8e6ee2f58cb810c4e7 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Tue, 24 Feb 2026 12:08:02 +0100 Subject: [PATCH] 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. --- _data/site.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/_data/site.js b/_data/site.js index 12e00ba..dd14545 100644 --- a/_data/site.js +++ b/_data/site.js @@ -16,8 +16,16 @@ function parseSocialLinks(envVar) { }); } -// Get Mastodon handle for fediverse:creator meta tag -function getMastodonHandle() { +// Get fediverse handle for fediverse:creator meta tag +// 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 user = process.env.MASTODON_USER || ""; if (instance && user) { @@ -104,8 +112,8 @@ export default { domain: process.env.SITE_URL?.replace("https://", "").replace("http://", "") || "example.com", }, - // Fediverse creator for meta tag (e.g., @rmdes@mstdn.social) - fediverseCreator: getMastodonHandle(), + // Fediverse creator for meta tag (e.g., @rick@rmendes.net) + fediverseCreator: getFediverseCreator(), // Support/monetization configuration (used in _textcasting JSON Feed extension) support: {