<script>
const themeChoice = localStorage.getItem("theme")
document.documentElement.classList.toggle(
"dark",
themeChoice !== null
? themeChoice === "dark"
: window.matchMedia("(prefers-color-scheme: dark)").matches
);
</script>
{{- $js := resources.Get "main.js" | js.Build | fingerprint -}}
<script src="{{ $js.RelPermalink }}" integrity="{{ $js.Data.Integrity }}" defer ></script>
{{ if site.Params.plausibleSiteID -}}
<script async defer data-domain="{{ site.Params.plausibleSiteID }}" src="{{ site.Params.plausibleTrackerURL | default "https://plausible.io/js/plausible.js" }}"></script>
{{ end -}}