From 6dce629c9cc4213d9d4e21128a5b0c757c335709 Mon Sep 17 00:00:00 2001 From: ahmad abdolsaheb Date: Tue, 17 Sep 2024 10:51:21 +0300 Subject: [PATCH 1/3] fix/add-gtm-script --- src/_includes/layouts/default.njk | 5 +++++ src/_includes/partials/gtm-body.njk | 4 ++++ src/_includes/partials/gtm-head.njk | 5 +++++ 3 files changed, 14 insertions(+) create mode 100644 src/_includes/partials/gtm-body.njk create mode 100644 src/_includes/partials/gtm-head.njk diff --git a/src/_includes/layouts/default.njk b/src/_includes/layouts/default.njk index 8df115bdd..e22c4f98d 100644 --- a/src/_includes/layouts/default.njk +++ b/src/_includes/layouts/default.njk @@ -59,6 +59,8 @@ {% block monetization %} {% endblock %} + {% include "partials/gtm-head.njk" %} + {# Dynamically load MathJax script #} {% block mathjax %} {% endblock %} @@ -133,6 +135,9 @@ {% else %} {% endif %} + + {% include "partials/gtm-body.njk" %} +
{% include "partials/site-nav.njk" %} diff --git a/src/_includes/partials/gtm-body.njk b/src/_includes/partials/gtm-body.njk new file mode 100644 index 000000000..870e395d8 --- /dev/null +++ b/src/_includes/partials/gtm-body.njk @@ -0,0 +1,4 @@ + + + diff --git a/src/_includes/partials/gtm-head.njk b/src/_includes/partials/gtm-head.njk new file mode 100644 index 000000000..6a39ba0e1 --- /dev/null +++ b/src/_includes/partials/gtm-head.njk @@ -0,0 +1,5 @@ + From 4d7862c303528c1685fce5a932998c5d404d2ee0 Mon Sep 17 00:00:00 2001 From: Ahmad Abdolsaheb Date: Wed, 18 Sep 2024 15:00:44 +0300 Subject: [PATCH 2/3] Update src/_includes/partials/gtm-body.njk --- src/_includes/partials/gtm-body.njk | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/_includes/partials/gtm-body.njk b/src/_includes/partials/gtm-body.njk index 870e395d8..9e83c2298 100644 --- a/src/_includes/partials/gtm-body.njk +++ b/src/_includes/partials/gtm-body.njk @@ -1,4 +1,2 @@ - - From 11bfa0c63503e0c22462a9baf5845fa14b6afb07 Mon Sep 17 00:00:00 2001 From: Ahmad Abdolsaheb Date: Thu, 19 Sep 2024 13:06:55 +0300 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Kristofer Koishigawa --- src/_includes/layouts/default.njk | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/_includes/layouts/default.njk b/src/_includes/layouts/default.njk index e22c4f98d..b69c7306b 100644 --- a/src/_includes/layouts/default.njk +++ b/src/_includes/layouts/default.njk @@ -59,7 +59,9 @@ {% block monetization %} {% endblock %} - {% include "partials/gtm-head.njk" %} + {% if secrets.eleventyEnv === 'prod' %} + {% include "partials/gtm-head.njk" %} + {% endif %} {# Dynamically load MathJax script #} {% block mathjax %} @@ -136,7 +138,9 @@ {% endif %} - {% include "partials/gtm-body.njk" %} + {% if secrets.eleventyEnv === 'prod' %} + {% include "partials/gtm-body.njk" %} + {% endif %}
{% include "partials/site-nav.njk" %}