summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorYuriy Andamasov <yuriy@vyos.io>2026-05-07 17:47:01 +0300
committerYuriy Andamasov <yuriy@vyos.io>2026-05-07 18:23:25 +0300
commit9a92db9d232d9f15eedb3b11a5e3190d164c99d8 (patch)
treee914fba4edc169e2a4055f0478a919fc440f837d /docs
parent4d8581c0e709848a601384addf3026fb405345fc (diff)
downloadvyos-documentation-9a92db9d232d9f15eedb3b11a5e3190d164c99d8.tar.gz
vyos-documentation-9a92db9d232d9f15eedb3b11a5e3190d164c99d8.zip
fix(docs): guard GTM/Cookiebot blocks with {% if gtm_id %}
Prevents broken googletagmanager.com requests with empty container IDs when GTM_ID is not set (local builds, preview environments). 🤖 Generated by [robots](https://vyos.io)
Diffstat (limited to 'docs')
-rw-r--r--docs/_templates/layout.html5
1 files changed, 4 insertions, 1 deletions
diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html
index cf25c15d..2521026b 100644
--- a/docs/_templates/layout.html
+++ b/docs/_templates/layout.html
@@ -1,6 +1,7 @@
{% extends "!layout.html" %}
{%- set current_version = "1.5.x circinus" %}
{% block extrahead %}
+ {% if gtm_id %}
{# Cookiebot CMP — must load first so its auto-blocker can scan/block other tags #}
<script id="Cookiebot"
src="https://consent.cookiebot.com/uc.js"
@@ -31,6 +32,7 @@
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','{{ gtm_id }}');</script>
+ {% endif %}
<style>#vyos-header-iframe{position:fixed;top:0;left:0;right:0;z-index:999999999;width:100%;border:none}</style>
<style>#vyos-footer-iframe{width:100%;border:none}</style>
@@ -62,9 +64,10 @@
{% endblock %}
{% block body %}
- {# GTM noscript fallback #}
+ {% if gtm_id %}
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id={{ gtm_id }}"
height="0" width="0" style="display:none;visibility:hidden"
title="Google Tag Manager"></iframe></noscript>
+ {% endif %}
{{ super() }}
{% endblock %}