analytics: only include umami script in production builds
This commit is contained in:
parent
53ae101b6d
commit
84a3e65c54
3 changed files with 14 additions and 4 deletions
|
@ -3,8 +3,8 @@
|
|||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"scripts": {
|
||||
"build": "rm -rf www && eleventy",
|
||||
"serve": "rm -rf www && eleventy --serve",
|
||||
"build": "ELEVENTY_ENV=prod rm -rf www && eleventy",
|
||||
"serve": "ELEVENTY_ENV=dev rm -rf www && eleventy --serve",
|
||||
"update": "git pull && npm i && npm run build"
|
||||
},
|
||||
"dependencies": {
|
||||
|
|
9
src/_data/env.js
Normal file
9
src/_data/env.js
Normal file
|
@ -0,0 +1,9 @@
|
|||
module.exports = function() {
|
||||
return {
|
||||
environment: {
|
||||
environment: process.env.ELEVENTY_ENV || "dev",
|
||||
isProd: process.env.ELEVENTY_ENV == "prod",
|
||||
isDev: (process.env.ELEVENTY_ENV || "dev") == "dev"
|
||||
}
|
||||
};
|
||||
}
|
|
@ -27,8 +27,9 @@
|
|||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
|
||||
<link rel="alternate" type="application/rss+xml" href="/feed.xml" />
|
||||
|
||||
<script async src="https://umami.crimew.gay/script.js" data-website-id="fa7a72e7-acbc-488d-beb2-213886be0262"></script>
|
||||
{% if env.environment.isProd %}
|
||||
<script async src="https://umami.crimew.gay/script.js" data-website-id="fa7a72e7-acbc-488d-beb2-213886be0262"></script>
|
||||
{% endif %}
|
||||
</head>
|
||||
<body>
|
||||
<header id="site_header">
|
||||
|
|
Loading…
Reference in a new issue