chore: merge to sveltekit #5
2 changed files with 20 additions and 1 deletions
17
src/lib/stores/Plausible.ts
Normal file
17
src/lib/stores/Plausible.ts
Normal file
|
@ -0,0 +1,17 @@
|
|||
import { browser } from '$app/environment';
|
||||
import { writable } from 'svelte/store';
|
||||
|
||||
const defaultValue = true;
|
||||
const initialValue = browser
|
||||
? window.localStorage.getItem('plausible_ignore') === 'true'
|
||||
: defaultValue;
|
||||
|
||||
const plausible = writable<boolean>(initialValue);
|
||||
|
||||
plausible.subscribe((value) => {
|
||||
if (browser) {
|
||||
window.localStorage.setItem('plausible_ignore', value ? 'true' : 'false');
|
||||
}
|
||||
});
|
||||
|
||||
export default plausible;
|
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import '../global.css';
|
||||
import '../app.css';
|
||||
|
||||
import { page } from '$app/stores';
|
||||
|
||||
|
@ -33,6 +33,8 @@
|
|||
property="twitter:description"
|
||||
content="Apprendre la programmation et la cybersécurité en s'amusant."
|
||||
/>
|
||||
|
||||
<script defer data-domain="app.peerat.dev" src="https://plosibl.peerat.dev/js/script.js"></script>
|
||||
</svelte:head>
|
||||
|
||||
<slot />
|
||||
|
|
Loading…
Add table
Reference in a new issue