diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index a364cca2e..d0630a20d 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -127,8 +127,11 @@
navigate: (url) => (window.location.href = url),
prefetch: () => {},
}
- init()
- render()
+
+ window.addEventListener("DOMContentLoaded", () => {
+ init()
+ render()
+ })
{{end}}