fix: show Fediverse button from mpSyndicateTo before syndication runs

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.
This commit is contained in:
Ricardo
2026-03-27 18:59:24 +01:00
parent 8af3cc329d
commit d3146bf0c1
+10
View File
@@ -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 %}
<footer class="post-footer mt-8 pt-6 border-t border-surface-200 dark:border-surface-700">
<div class="flex flex-wrap items-center gap-4">