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"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="JavaScriptLibraryMappings"> <component name="JavaScriptLibraryMappings">
<includedPredefinedLibrary name="Node.js Core" /> <file url="PROJECT" libraries="{plausible}" />
</component> </component>
</project> </project>

View File

@ -9,5 +9,6 @@
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" name="plausible" level="application" />
</component> </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 { interface ImportMetaEnv {
readonly CONTENTFUL_SPACE_ID: string; readonly CONTENTFUL_SPACE_ID: string;
readonly CONTENTFUL_DELIVERY_TOKEN: string; readonly CONTENTFUL_DELIVERY_TOKEN: string;
readonly CONTENTFUL_PREVIEW_TOKEN: string;
readonly WEBHOOK_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 { export interface Props {
title: string; title: string;
} }
@ -28,6 +30,7 @@ const { title } = Astro.props;
<footer> <footer>
© Les Particules 2024 © Les Particules 2024
</footer> </footer>
<Plausible />
</body> </body>
</html> </html>
<style is:global> <style is:global>