This commit is contained in:
not-nullptr 2024-11-15 12:48:15 +00:00
parent 156bc89073
commit 02cf3d8d41
3 changed files with 6 additions and 1 deletions

View File

@ -16,6 +16,9 @@ class Theme {
expires: 2147483647,
});
log(["theme"], `set to ${this.dark ? "dark" : "light"}`);
window.plausible("Theme set", {
props: { theme: theme.dark ? "dark" : "light" },
});
};
}

View File

@ -110,7 +110,6 @@
{#if PUB_PLAUSIBLE_URL}<script
defer
data-domain={PUB_HOSTNAME || "vert.sh"}
event-Theme={theme.dark ? "dark" : "light"}
src="{PUB_PLAUSIBLE_URL}/js/script.pageview-props.tagged-events.js"
></script>{/if}
</svelte:head>

View File

@ -16,5 +16,8 @@ export const load = ({ data }) => {
theme.dark = themeStr === "dark";
}
theme.dark = JSCookie.get("theme") === "dark";
window.plausible("Theme set", {
props: { theme: theme.dark ? "dark" : "light" },
});
return data;
};