feat: ajoute Plausible

main
Jalil Arfaoui 2024-01-03 15:06:05 +01:00
parent ab876dc468
commit d3c9c8175b
5 changed files with 13 additions and 4 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptLibraryMappings">
<includedPredefinedLibrary name="Node.js Core" />
<file url="PROJECT" libraries="{plausible}" />
</component>
</project>
</project>

View File

@ -9,5 +9,6 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="plausible" level="application" />
</component>
</module>
</module>

View File

@ -0,0 +1,5 @@
---
const domain = import.meta.env.PLAUSIBLE_DOMAIN;
---
<script defer data-domain=`${domain}` src="https://plausible.io/js/plausible.js"></script>

2
src/env.d.ts vendored
View File

@ -2,6 +2,6 @@
interface ImportMetaEnv {
readonly CONTENTFUL_SPACE_ID: string;
readonly CONTENTFUL_DELIVERY_TOKEN: string;
readonly CONTENTFUL_PREVIEW_TOKEN: string;
readonly WEBHOOK_TOKEN: string;
readonly PLAUSIBLE_DOMAIN: string;
}

View File

@ -1,4 +1,6 @@
---
import Plausible from "../components/Plausible.astro";
export interface Props {
title: string;
}
@ -28,6 +30,7 @@ const { title } = Astro.props;
<footer>
© Les Particules 2024
</footer>
<Plausible />
</body>
</html>
<style is:global>