From d055408aade9bc961359595a4b793b3c9b676917 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Thu, 19 Feb 2026 16:08:20 +0100 Subject: [PATCH] feat: append permalink to syndicated AP content + bump to 1.0.5 Notes and articles syndicated to ActivityPub now include a clickable link back to the canonical post URL at the end of the content body. This ensures fediverse clients display a visible permalink, since the Note url property alone is not shown inline by most implementations. --- lib/jf2-to-as2.js | 11 +++++++++++ package.json | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/jf2-to-as2.js b/lib/jf2-to-as2.js index e8b4b6c..9e64501 100644 --- a/lib/jf2-to-as2.js +++ b/lib/jf2-to-as2.js @@ -82,6 +82,11 @@ export function jf2ToActivityStreams(properties, actorUrl, publicationUrl) { object.content = properties.content?.html || properties.content || ""; } + // Append permalink to content so fediverse clients show a clickable link + if (postUrl && object.content) { + object.content += `

\u{1F517} ${postUrl}

`; + } + if (isArticle) { object.name = properties.name; if (properties.summary) { @@ -180,6 +185,12 @@ export function jf2ToAS2Activity(properties, actorUrl, publicationUrl) { noteOptions.content = properties.content?.html || properties.content || ""; } + // Append permalink to content so fediverse clients show a clickable link + // back to the canonical post on the author's site + if (postUrl && noteOptions.content) { + noteOptions.content += `

\u{1F517} ${postUrl}

`; + } + if (isArticle) { noteOptions.name = properties.name; if (properties.summary) { diff --git a/package.json b/package.json index dd95ebf..3f38aeb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@rmdes/indiekit-endpoint-activitypub", - "version": "1.0.4", + "version": "1.0.5", "description": "ActivityPub federation endpoint for Indiekit via Fedify. Adds full fediverse support: actor, inbox, outbox, followers, following, syndication, and Mastodon migration.", "keywords": [ "indiekit",