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 %}