From 871851e13dbd80678ec99f61b3e7b2a49b394c21 Mon Sep 17 00:00:00 2001 From: Jalil Arfaoui Date: Wed, 27 Jul 2022 19:15:03 +0200 Subject: [PATCH] =?UTF-8?q?chore:=20met=20le=20domain=20Plausible=20en=20v?= =?UTF-8?q?ariable=20d=E2=80=99environnement?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .eleventy.js | 2 ++ .env.example | 1 + package-lock.json | 16 ++++++++++++++++ package.json | 1 + src/_data/env.js | 5 +++++ src/_includes/layouts/base.njk | 2 +- 6 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 .env.example create mode 100644 src/_data/env.js diff --git a/.eleventy.js b/.eleventy.js index 89c75ec..fe0b93c 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -1,3 +1,5 @@ +require('dotenv').config() + const { DateTime } = require("luxon"); const pluginNavigation = require("@11ty/eleventy-navigation"); diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..3ac764e --- /dev/null +++ b/.env.example @@ -0,0 +1 @@ +PLAUSIBLE_DOMAIN=nonscollectif.org diff --git a/package-lock.json b/package-lock.json index 56af206..0ea3883 100644 --- a/package-lock.json +++ b/package-lock.json @@ -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", diff --git a/package.json b/package.json index 16c5d40..28015d3 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/_data/env.js b/src/_data/env.js new file mode 100644 index 0000000..a5138b0 --- /dev/null +++ b/src/_data/env.js @@ -0,0 +1,5 @@ +module.exports = function() { + return { + PLAUSIBLE_DOMAIN: process.env.PLAUSIBLE_DOMAIN || "nonscollectif.org" + }; +}; diff --git a/src/_includes/layouts/base.njk b/src/_includes/layouts/base.njk index 829b85c..dab59a8 100644 --- a/src/_includes/layouts/base.njk +++ b/src/_includes/layouts/base.njk @@ -46,6 +46,6 @@ - +