Przeglądaj źródła

fix: restore analytics environment variables in appData

codecalm 2 tygodni temu
rodzic
commit
dbb5e7d2ed
2 zmienionych plików z 4 dodań i 4 usunięć
  1. 0 4
      preview/eleventy.config.mjs
  2. 4 0
      shared/e11ty/data.mjs

+ 0 - 4
preview/eleventy.config.mjs

@@ -36,10 +36,6 @@ export default function (eleventyConfig) {
 	eleventyConfig.addGlobalData("environment", environment);
 	eleventyConfig.addGlobalData("readme", readFileSync(join("..", "README.md"), "utf-8"));
 	eleventyConfig.addGlobalData("license", readFileSync(join("..", "LICENSE"), "utf-8"));
-	
-	// PostHog Analytics Environment Variables
-	eleventyConfig.addGlobalData("posthogApiKey", process.env.NEXT_PUBLIC_POSTHOG_KEY);
-	eleventyConfig.addGlobalData("posthogHost", process.env.NEXT_PUBLIC_POSTHOG_HOST);
 
 	eleventyConfig.addGlobalData("pages", () => {
 		return sync('pages/**/*.html').filter((file) => {

+ 4 - 0
shared/e11ty/data.mjs

@@ -5,4 +5,8 @@ export function appData(eleventyConfig) {
 	eleventyConfig.addGlobalData("package", JSON.parse(readFileSync(join("..", "core", "package.json"), "utf-8")));
 	eleventyConfig.addGlobalData("changelog", readFileSync(join("..", "core", "CHANGELOG.md"), "utf-8"));
 	eleventyConfig.addGlobalData("libs", JSON.parse(readFileSync(join("..", "core", "libs.json"), "utf-8")));
+
+	// Analytics Environment Variables
+	eleventyConfig.addGlobalData("posthogApiKey", process.env.NEXT_PUBLIC_POSTHOG_KEY);
+	eleventyConfig.addGlobalData("posthogHost", process.env.NEXT_PUBLIC_POSTHOG_HOST);
 }