chore: met le domain Plausible en variable d’environnement

pull/1/head
Jalil Arfaoui 2022-07-27 19:15:03 +02:00
parent 5ee4f30bfd
commit 871851e13d
6 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,5 @@
require('dotenv').config()
const { DateTime } = require("luxon");
const pluginNavigation = require("@11ty/eleventy-navigation");

1
.env.example Normal file
View File

@ -0,0 +1 @@
PLAUSIBLE_DOMAIN=nonscollectif.org

16
package-lock.json generated
View File

@ -13,6 +13,7 @@
"@11ty/eleventy-navigation": "^0.3.3",
"autoprefixer": "^10.4.7",
"concurrently": "^7.3.0",
"dotenv": "^16.0.1",
"markdown-it": "^13.0.1",
"markdown-it-attrs": "^4.1.4",
"postcss-cli": "^10.0.0",
@ -1138,6 +1139,15 @@
"integrity": "sha512-LLBi6pEqS6Do3EKQ3J0NqHWV5hhb78Pi8vvESYwyOy2c31ZEZVdtitdzsQsKb7878PEERhzUk0ftqGhG6Mz+pQ==",
"dev": true
},
"node_modules/dotenv": {
"version": "16.0.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz",
"integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==",
"dev": true,
"engines": {
"node": ">=12"
}
},
"node_modules/easy-extender": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/easy-extender/-/easy-extender-2.3.4.tgz",
@ -5176,6 +5186,12 @@
"integrity": "sha512-LLBi6pEqS6Do3EKQ3J0NqHWV5hhb78Pi8vvESYwyOy2c31ZEZVdtitdzsQsKb7878PEERhzUk0ftqGhG6Mz+pQ==",
"dev": true
},
"dotenv": {
"version": "16.0.1",
"resolved": "https://registry.npmjs.org/dotenv/-/dotenv-16.0.1.tgz",
"integrity": "sha512-1K6hR6wtk2FviQ4kEiSjFiH5rpzEVi8WW0x96aztHVMhEspNpc4DVOUTEHtEva5VThQ8IaBX1Pe4gSzpVVUsKQ==",
"dev": true
},
"easy-extender": {
"version": "2.3.4",
"resolved": "https://registry.npmjs.org/easy-extender/-/easy-extender-2.3.4.tgz",

View File

@ -18,6 +18,7 @@
"@11ty/eleventy-navigation": "^0.3.3",
"autoprefixer": "^10.4.7",
"concurrently": "^7.3.0",
"dotenv": "^16.0.1",
"markdown-it": "^13.0.1",
"markdown-it-attrs": "^4.1.4",
"postcss-cli": "^10.0.0",

5
src/_data/env.js Normal file
View File

@ -0,0 +1,5 @@
module.exports = function() {
return {
PLAUSIBLE_DOMAIN: process.env.PLAUSIBLE_DOMAIN || "nonscollectif.org"
};
};

View File

@ -46,6 +46,6 @@
<!-- Current page: {{ page.url | url }} -->
<script defer data-domain="nonscollectif.org" src="https://plausible.io/js/plausible.js"></script>
<script defer data-domain="{{ env.PLAUSIBLE_DOMAIN }}" src="https://plausible.io/js/plausible.js"></script>
</body>
</html>