Skip to content

Commit

Permalink
[front-end] index.html - add Umami analytics link
Browse files Browse the repository at this point in the history
The placeholders are replaced with Vite evironment variables courtesy
of HTML Env replacement

https://vite.dev/guide/env-and-mode.html#html-env-replacement

Also add examples in .env.example.
  • Loading branch information
Nick Stokoe committed Dec 6, 2024
1 parent 4b6f360 commit 7d1d914
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions apps/front-end/.env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
VITE_API_URL=replace-me
VITE_MAPTILER_API_KEY=replace-me

# For Umami analytics, this URL needs to be set
VITE_UMAMI_URL=<For DCC this is: https://umami.digitalcommons.coop/script.js>
VITE_UMAMI_ID=<get this from the Umami dashboard>
1 change: 1 addition & 0 deletions apps/front-end/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<link rel="icon" type="image/x-icon" href="favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Cooperative World Map</title>
<script defer src="%VITE_UMAMI_URL%" data-website-id="%VITE_UMAMI_ID%"></script>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down

0 comments on commit 7d1d914

Please sign in to comment.