From d3146bf0c10a253158c77b9bb26bcbebbad4c018 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Fri, 27 Mar 2026 18:59:24 +0100 Subject: [PATCH] fix: show Fediverse button from mpSyndicateTo before syndication runs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Fediverse button only appeared after the syndication endpoint wrote the syndication array to frontmatter. If the Eleventy watcher missed the second file update (timing race), the button never showed. Now falls back to mpSyndicateTo — which is written at post creation time — to render the button on the first build. Once syndication populates the syndication array, it takes over. --- _includes/layouts/post.njk | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/_includes/layouts/post.njk b/_includes/layouts/post.njk index 9418436..d7a04ba 100644 --- a/_includes/layouts/post.njk +++ b/_includes/layouts/post.njk @@ -112,6 +112,16 @@ withBlogSidebar: true {% endif %} {% endfor %} {% endif %} + {# Fallback: if no selfHostedApUrl from syndication yet, check mpSyndicateTo. + This ensures the Fediverse button appears on the first build, before the + syndication endpoint has run and added the URL to the syndication array. #} + {% if not selfHostedApUrl and mpSyndicateTo %} + {% for url in mpSyndicateTo %} + {% if url.indexOf(site.url) == 0 %} + {% set selfHostedApUrl = page.url | url %} + {% endif %} + {% endfor %} + {% endif %} {% if externalSyndication.length or selfHostedApUrl %}