From 32015fb239ac40437d07f33e753c685d229b0642 Mon Sep 17 00:00:00 2001
From: Nouri-Alnahawi <nouri.alnahawi@h-da.de>
Date: Thu, 15 Jul 2021 12:52:15 +0200
Subject: [PATCH] add google analytics property

---
 .gitlab-ci.yml | 3 ++-
 config.toml    | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index aa1fec0..9f52d17 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -6,6 +6,7 @@ variables:
   MINDMAP_OUT_PATH: ./layouts/shortcodes/mindmap.html
   MINDMAP_IN_PATH: ./mindmap_gen/mindmap.md
   MINDMAP_SCRIPT_PATH: ./mindmap_gen/mindmap_gen.py
+  HUGO_ENV: production
 
 .job_templae: &script
   before_script:
@@ -19,7 +20,7 @@ variables:
   - python3 $MINDMAP_SCRIPT_PATH -d $(pwd)/content                # Generate the mindmap md file
   - npx markmap-cli -o $MINDMAP_OUT_PATH $MINDMAP_IN_PATH         # Convert mindmap md file to html
   - sed -i 's/100v/60v/g' $(pwd)/layouts/shortcodes/mindmap.html  # Replaces the width and hight of mindmap with suitable values
-  - hugo --minify --gc
+  - hugo --minify --gc --environment production
 
 test:
   <<: *script
diff --git a/config.toml b/config.toml
index 6187881..9705a2c 100644
--- a/config.toml
+++ b/config.toml
@@ -52,6 +52,10 @@ anchor = "smart"
       # Uncomment if you want your chosen highlight style used for code blocks without a specified language
       # guessSyntax = "true"
 
+# Google Analytics Settings
+# Requires adding env to build: HUGO_ENV="production" hugo
+[services.googleAnalytics]
+id = "UA-202391736-1"
 
 [params]
 copyright = "Darmstadt University of Applied Sciences"
-- 
GitLab