From 859785658949ae62e879739b564405de7a7d8550 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Sun, 22 Feb 2026 15:56:01 +0100 Subject: [PATCH] feat: add fediverse remote interaction button and syndication platform buttons Add a Fediverse button to the "Also on" footer for posts syndicated via self-hosted ActivityPub. Clicking it redirects users to their own instance via authorize_interaction so they can like/boost/reply natively. Instance is stored in localStorage for repeat visits, with a modal for first-time entry and Shift+click to change. Also adds branded syndication buttons for LinkedIn and IndieNews, and replaces the heuristic Mastodon URL detection with exact matching against the configured MASTODON_INSTANCE. --- _includes/layouts/base.njk | 1 + _includes/layouts/post.njk | 97 +++++++++++++++++++++++++++++++-- js/fediverse-interact.js | 107 +++++++++++++++++++++++++++++++++++++ 3 files changed, 201 insertions(+), 4 deletions(-) create mode 100644 js/fediverse-interact.js diff --git a/_includes/layouts/base.njk b/_includes/layouts/base.njk index 5e794fe..043268e 100644 --- a/_includes/layouts/base.njk +++ b/_includes/layouts/base.njk @@ -75,6 +75,7 @@ {# Alpine.js components — MUST load before Alpine core (Alpine.data() registration via alpine:init) #} + diff --git a/_includes/layouts/post.njk b/_includes/layouts/post.njk index 9b54a0a..0eab3ef 100644 --- a/_includes/layouts/post.njk +++ b/_includes/layouts/post.njk @@ -72,20 +72,95 @@ withBlogSidebar: true {% endif %} {# Syndication Footer - shows where this post was also published #} - {# Skip syndication URLs that point back to our own site (self-hosted AP) #} + {# Separate self-hosted AP URLs from external syndication targets #} {% set externalSyndication = [] %} + {% set selfHostedApUrl = "" %} {% if syndication %} {% for url in syndication %} - {% if url.indexOf(site.url) != 0 %} + {% if url.indexOf(site.url) == 0 %} + {% set selfHostedApUrl = url %} + {% else %} {% set externalSyndication = (externalSyndication.push(url), externalSyndication) %} {% endif %} {% endfor %} {% endif %} - {% if externalSyndication.length %} + {% if externalSyndication.length or selfHostedApUrl %}