impress-2020/pages/_document.tsx
Emi Matchu 054dd484a5 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.
2024-08-27 11:09:47 -07:00

82 lines
2.1 KiB
XML

import { ColorModeScript } from "@chakra-ui/react";
import Document, { Html, Head, Main, NextScript } from "next/document";
class MyDocument extends Document {
render() {
return (
<Html lang="en">
<Head>
<meta charSet="utf-8" />
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="favicon-16x16.png"
/>
<meta name="theme-color" content="#000000" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="/apple-touch-icon.png"
/>
<style
type="text/css"
dangerouslySetInnerHTML={{
__html: `
/* A font by Jos Buivenga (exljbris) -> www.exljbris.com */
@font-face {
font-family: "Delicious";
font-display: block; /* used for large-but-late subheadings */
font-weight: 700;
src: url(/fonts/Delicious-Bold.otf);
}
@font-face {
font-family: "Delicious";
font-display: swap; /* used for page titles */
font-weight: 800 1000;
src: url(/fonts/Delicious-Heavy.otf);
}
`,
}}
/>
<link
rel="preload"
href="/fonts/Delicious-Heavy.otf"
type="font/otf"
as="font"
crossOrigin=""
/>
<link
rel="preload"
href="/fonts/Delicious-Bold.otf"
type="font/otf"
as="font"
crossOrigin=""
/>
<ColorModeScript initialColorMode="light" />
<noscript>You need to enable JavaScript to run this app.</noscript>
</Head>
<body>
<Main />
<NextScript />
<script
defer
data-domain="impress-2020.openneo.net"
src="https://analytics.openneo.net/js/script.js"
dangerouslySetInnerHTML={{ __html: `` }}
/>
</body>
</Html>
);
}
}
export default MyDocument;