From f3268ed3f9e132f4dfc20afc842e225a1feb1128 Mon Sep 17 00:00:00 2001 From: Ricardo Date: Sat, 21 Feb 2026 22:46:43 +0100 Subject: [PATCH] fix: load comments.js before Alpine in head (correct defer order) Alpine CDN uses queueMicrotask to auto-start, which fires between defer scripts. comments.js must execute before Alpine so its alpine:init listener is registered before Alpine.start() runs. This is the Alpine-documented pattern: "Include [component scripts] before Alpine's core JS file." --- _includes/layouts/base.njk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_includes/layouts/base.njk b/_includes/layouts/base.njk index 56f192d..5e794fe 100644 --- a/_includes/layouts/base.njk +++ b/_includes/layouts/base.njk @@ -73,6 +73,8 @@ + {# Alpine.js components — MUST load before Alpine core (Alpine.data() registration via alpine:init) #} + @@ -440,8 +442,6 @@ {# Client-side webmention fetcher - supplements build-time cache with real-time data #} - {# Client-side comments - IndieAuth login + comment submission #} - {# Admin auth detection - shows dashboard link + FAB when logged in #}