Ahh beans, don't block the page JS on the analytics script

The analytics service is down rn for reasons I haven't had time to investigate, and oops, using the `defer` attribute *does* defer the script until the page has loaded, but it *also* maintains the ordering.

I could also use `async` here, but I don't know enough about the Plausible script to know if it cares about the DOM being loaded. Instead, I'll keep it the same, but move it after the Next.js script tag.
This commit is contained in:
Emi Matchu 2024-08-27 11:01:05 -07:00
parent 00d57518f1
commit 054dd484a5

View file

@ -46,12 +46,6 @@ class MyDocument extends Document {
`,
}}
/>
<script
defer
data-domain="impress-2020.openneo.net"
src="https://analytics.openneo.net/js/script.js"
dangerouslySetInnerHTML={{ __html: `` }}
/>
<link
rel="preload"
href="/fonts/Delicious-Heavy.otf"
@ -73,6 +67,12 @@ class MyDocument extends Document {
<body>
<Main />
<NextScript />
<script
defer
data-domain="impress-2020.openneo.net"
src="https://analytics.openneo.net/js/script.js"
dangerouslySetInnerHTML={{ __html: `` }}
/>
</body>
</Html>
);