Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-docs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchilleas Pipinellis <axil@gitlab.com>2023-06-02 13:46:01 +0300
committerAchilleas Pipinellis <axil@gitlab.com>2023-06-02 13:46:01 +0300
commitd17f245968d845be2812b564836c2cd377f6edf2 (patch)
treebbbce3b01792b32e35b58eb443ede1b0e368c373
parentbb3a759d3cea5804a5b3cbda88cd9ffa07cc2811 (diff)
parent1e3b77d489a2687aefa8f17993adaf32e79b9b2d (diff)
Merge branch 'cherry-pick-69942af7-14.5' into '14.5'14.5
Load the analytics only in the main site (14.5 backport) See merge request https://gitlab.com/gitlab-org/gitlab-docs/-/merge_requests/3917 Merged-by: Achilleas Pipinellis <axil@gitlab.com> Co-authored-by: Sarah German <sgerman@gitlab.com>
-rw-r--r--.gitlab-ci.yml124
-rw-r--r--layouts/404.html8
-rw-r--r--layouts/analytics.html2
-rw-r--r--layouts/default.html6
-rw-r--r--layouts/gtm.html2
-rw-r--r--layouts/head.html16
-rw-r--r--layouts/home.html4
-rw-r--r--layouts/instantsearch.html5
8 files changed, 80 insertions, 87 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index b2c3a1db..3792c3a5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -386,72 +386,72 @@ test_unlinked_images:
#
# Deploy the Review App on a dev server
#
-review:
- stage: deploy
- extends:
- - .retry
- variables:
- GIT_STRATEGY: none
- needs:
- - compile_dev
- before_script: []
- cache: {}
- script:
- # Rsync to the Pages dir
- - rsync -av --delete public /srv/nginx/pages/$CI_COMMIT_REF_SLUG$REVIEW_SLUG
- # Remove public directory so that the next review app can run in a
- # clean environment (limitation of the shell executor).
- - rm -rf public
- environment:
- name: review/$CI_COMMIT_REF_SLUG$REVIEW_SLUG
- url: http://$CI_COMMIT_REF_SLUG$REVIEW_SLUG.$APPS_DOMAIN
- on_stop: review_stop
- rules:
- - if: '$CI_PROJECT_PATH == "gitlab-renovate-forks/gitlab-docs"'
- when: manual
- - if: '$CI_PROJECT_PATH !~ /^gitlab-org/'
- when: never
- - if: '$CI_MERGE_REQUEST_ID'
- - if: '$CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "trigger"'
- - if: '$CI_COMMIT_BRANCH =~ /docs-preview/' # TODO: Remove once no projects create such branch
- tags:
- - nginx
- - review-apps
+#review:
+# stage: deploy
+# extends:
+# - .retry
+# variables:
+# GIT_STRATEGY: none
+# needs:
+# - compile_dev
+# before_script: []
+# cache: {}
+# script:
+# # Rsync to the Pages dir
+# - rsync -av --delete public /srv/nginx/pages/$CI_COMMIT_REF_SLUG$REVIEW_SLUG
+# # Remove public directory so that the next review app can run in a
+# # clean environment (limitation of the shell executor).
+# - rm -rf public
+# environment:
+# name: review/$CI_COMMIT_REF_SLUG$REVIEW_SLUG
+# url: http://$CI_COMMIT_REF_SLUG$REVIEW_SLUG.$APPS_DOMAIN
+# on_stop: review_stop
+# rules:
+# - if: '$CI_PROJECT_PATH == "gitlab-renovate-forks/gitlab-docs"'
+# when: manual
+# - if: '$CI_PROJECT_PATH !~ /^gitlab-org/'
+# when: never
+# - if: '$CI_MERGE_REQUEST_ID'
+# - if: '$CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "trigger"'
+# - if: '$CI_COMMIT_BRANCH =~ /docs-preview/' # TODO: Remove once no projects create such branch
+# tags:
+# - nginx
+# - review-apps
#
# Stop the Review App
#
-review_stop:
- stage: deploy
- extends:
- - .retry
- variables:
- GIT_STRATEGY: none
- needs: []
- artifacts: {}
- before_script: []
- cache: {}
- script:
- - rm -rf public /srv/nginx/pages/$CI_COMMIT_REF_SLUG$REVIEW_SLUG
- environment:
- name: review/$CI_COMMIT_REF_SLUG$REVIEW_SLUG
- action: stop
- rules:
- - if: '$CI_PROJECT_PATH == "gitlab-renovate-forks/gitlab-docs"'
- allow_failure: true
- when: manual
- - if: '$CI_PROJECT_PATH !~ /^gitlab-org/'
- when: never
- - if: '$CI_MERGE_REQUEST_ID || $CI_PIPELINE_SOURCE == "pipeline"|| $CI_PIPELINE_SOURCE == "trigger"'
- allow_failure: true
- when: manual
- # TODO: Remove once no projects create such branch
- - if: '$CI_COMMIT_BRANCH =~ /docs-preview/'
- allow_failure: true
- when: manual
- tags:
- - nginx
- - review-apps
+#review_stop:
+# stage: deploy
+# extends:
+# - .retry
+# variables:
+# GIT_STRATEGY: none
+# needs: []
+# artifacts: {}
+# before_script: []
+# cache: {}
+# script:
+# - rm -rf public /srv/nginx/pages/$CI_COMMIT_REF_SLUG$REVIEW_SLUG
+# environment:
+# name: review/$CI_COMMIT_REF_SLUG$REVIEW_SLUG
+# action: stop
+# rules:
+# - if: '$CI_PROJECT_PATH == "gitlab-renovate-forks/gitlab-docs"'
+# allow_failure: true
+# when: manual
+# - if: '$CI_PROJECT_PATH !~ /^gitlab-org/'
+# when: never
+# - if: '$CI_MERGE_REQUEST_ID || $CI_PIPELINE_SOURCE == "pipeline"|| $CI_PIPELINE_SOURCE == "trigger"'
+# allow_failure: true
+# when: manual
+# # TODO: Remove once no projects create such branch
+# - if: '$CI_COMMIT_BRANCH =~ /docs-preview/'
+# allow_failure: true
+# when: manual
+# tags:
+# - nginx
+# - review-apps
#
# Clean up review apps and free disk space
diff --git a/layouts/404.html b/layouts/404.html
index b4740b4c..bf856829 100644
--- a/layouts/404.html
+++ b/layouts/404.html
@@ -13,17 +13,15 @@
<div class="col-12">
<%= yield %>
<%= render '/footer.*' %>
+ </div>
</div>
- </div>
- </section>
+ </section>
<script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js" integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0=" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.bundle.min.js" integrity="sha384-LtrjvnR4Twt/qOuYxE721u19sVFLVSA4hf/rRt6PrZTmiPltdZcI7q7PXQBYTKyf" crossorigin="anonymous"></script>
<script type="application/javascript" src="<%= @items['/assets/javascripts/404.*'].path %>"></script>
<script src="<%= @items['/frontend/404/404.*'].path %>"></script>
<%= render '/docsearch.*' %>
- <% if production? %>
<%# Add analytics only in production %>
- <%= render '/analytics.*' %>
- <% end %>
+ <%= render '/analytics.*' %>
</body>
</html>
diff --git a/layouts/analytics.html b/layouts/analytics.html
index 3f8a9985..f18097f5 100644
--- a/layouts/analytics.html
+++ b/layouts/analytics.html
@@ -1,3 +1,4 @@
+<% if production_and_default_branch? %>
<!-- Facebook -->
<script src="<%= @items['/assets/javascripts/facebook_analytics.*'].path %>"></script>
<noscript><img height="1" width="1" style="display:none"
@@ -19,3 +20,4 @@ src="https://www.facebook.com/tr?id=1689559637958103&ev=PageView&noscript=1"
<noscript>
<img height="1" width="1" style="display:none;" alt="" src="https://dc.ads.linkedin.com/collect/?pid=30694&fmt=gif" />
</noscript>
+<% end %>
diff --git a/layouts/default.html b/layouts/default.html
index f04a5daf..34d0f9c6 100644
--- a/layouts/default.html
+++ b/layouts/default.html
@@ -101,10 +101,9 @@
<script type="application/javascript" src="<%= @items['/assets/javascripts/badges.*'].path %>"></script>
<%= render '/docsearch.*' %>
<script src="<%= @items['/assets/javascripts/mermaid.*'].path %>"></script>
- <% if production? %>
+
<%# Add analytics only in production %>
- <%= render '/analytics.*' %>
- <% end %>
+ <%= render '/analytics.*' %>
<script src="<%= @items['/frontend/header/index.*'].path %>"></script>
<script src="<%= @items['/assets/javascripts/docs.*'].path %>"></script>
<script src="<%= @items['/assets/javascripts/global-nav.*'].path %>"></script>
@@ -112,4 +111,3 @@
<script src="<%= @items['/frontend/default/default.*'].path %>"></script>
</body>
</html>
-
diff --git a/layouts/gtm.html b/layouts/gtm.html
index 87ebf4cb..bf124396 100644
--- a/layouts/gtm.html
+++ b/layouts/gtm.html
@@ -1,4 +1,4 @@
-<% if production? and ENV['CI_COMMIT_REF_NAME'] == ENV['CI_DEFAULT_BRANCH'] %>
+<% if production_and_default_branch? %>
<%# Adds GTM only in production // leave this immediately after the opening the body tag%>
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WZCXKT5"
diff --git a/layouts/head.html b/layouts/head.html
index fc114493..21cf0a42 100644
--- a/layouts/head.html
+++ b/layouts/head.html
@@ -43,19 +43,17 @@
<!-- end of docsearch -->
<% if production? %>
- <%# Adds GTM only in production %>
- <!-- add cookie consent -->
- <script type="text/javascript" src="https://cdn.cookielaw.org/consent/7f944245-c5cd-4eed-a90e-dd955adfdd08/OtAutoBlock.js">
- </script>
-
- <script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="7f944245-c5cd-4eed-a90e-dd955adfdd08">
- </script>
-
+ <!-- OneTrust Cookies Consent Notice start -->
+ <script src="https://cdn.cookielaw.org/consent/7f944245-c5cd-4eed-a90e-dd955adfdd08/OtAutoBlock.js"></script>
+ <script src="https://cdn.cookielaw.org/scripttemplates/otSDKStub.js" charset="UTF-8" data-domain-script="7f944245-c5cd-4eed-a90e-dd955adfdd08"></script>
<script type="text/javascript">
function OptanonWrapper() { }
</script>
+ <!-- OneTrust Cookies Consent Notice end -->
+<% end %>
-
+<% if production_and_default_branch? %>
+ <%# Adds GTM only in production %>
<!-- Google Tag Manager -->
<script src="<%= @items['/assets/javascripts/google_tagmanager.*'].path %>"></script>
<!-- End Google Tag Manager -->
diff --git a/layouts/home.html b/layouts/home.html
index d5aefa52..fba3de9c 100644
--- a/layouts/home.html
+++ b/layouts/home.html
@@ -9,10 +9,8 @@
<%= render '/header.*' %>
<%= yield %>
<%= render '/docsearch.*' %>
- <% if production? and ENV['CI_COMMIT_REF_NAME'] == ENV['CI_DEFAULT_BRANCH'] %>
<%# Add analytics only in production %>
- <%= render '/analytics.*' %>
- <% end %>
+ <%= render '/analytics.*' %>
<%= render '/schema-microdata.*' %>
<script src="<%= @items['/frontend/header/index.*'].path %>"></script>
<script src="<%= @items['/frontend/home/index.*'].path %>"></script>
diff --git a/layouts/instantsearch.html b/layouts/instantsearch.html
index 98f2b0bd..0d1b6ad6 100644
--- a/layouts/instantsearch.html
+++ b/layouts/instantsearch.html
@@ -23,10 +23,9 @@
<script type="application/javascript" src="<%= @items['/assets/javascripts/badges.*'].path %>"></script>
<script src="<%= @items['/frontend/header/index.*'].path %>"></script>
<script src="<%= @items['/frontend/search/index.*'].path %>"></script>
- <% if production? %>
+
<%# Add analytics only in production %>
- <%= render '/analytics.*' %>
- <% end %>
+ <%= render '/analytics.*' %>
<%= render '/schema-microdata.*' %>
</body>
</html>