diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-07 17:53:41 +0300 |
|---|---|---|
| committer | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-07 18:02:34 +0300 |
| commit | c3a0426c7b4f2e874ce4d568c908e1f619dfaa4e (patch) | |
| tree | 1c55f58f0baaa50ed8da66cc642c40cb6315e829 | |
| parent | 82c53b5444c75f7e2d0cc1e462616ff8d5fc3c10 (diff) | |
| download | vyos-documentation-c3a0426c7b4f2e874ce4d568c908e1f619dfaa4e.tar.gz vyos-documentation-c3a0426c7b4f2e874ce4d568c908e1f619dfaa4e.zip | |
feat(docs): move Cookiebot CBID to COOKIEBOT_ID env var
Read COOKIEBOT_ID from the environment via conf.py html_context,
replacing the hardcoded data-cbid value in layout.html.
Guards tightened to {% if gtm_id and cookiebot_id %} so neither
GTM nor Cookiebot loads unless both IDs are present.
🤖 Generated by [robots](https://vyos.io)
| -rw-r--r-- | docs/_templates/layout.html | 6 | ||||
| -rw-r--r-- | docs/conf.py | 1 |
2 files changed, 4 insertions, 3 deletions
diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index e4781d89..6c100ca9 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -1,11 +1,11 @@ {% extends "!layout.html" %} {%- set current_version = "1.4.x sagitta" %} {% block extrahead %} - {% if gtm_id %} + {% if gtm_id and cookiebot_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" - data-cbid="932cb8b9-5141-4dc9-9018-21fc31a0586f" + data-cbid="{{ cookiebot_id }}" data-blockingmode="auto" type="text/javascript"></script> @@ -64,7 +64,7 @@ {% endblock %} {% block body %} - {% if gtm_id %} + {% if gtm_id and cookiebot_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> diff --git a/docs/conf.py b/docs/conf.py index cbee4a36..7f4bf4eb 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -148,6 +148,7 @@ html_context = { 'github_version': _github_version, 'conf_py_path': '/docs/', 'gtm_id': os.environ.get('GTM_ID', ''), + 'cookiebot_id': os.environ.get('COOKIEBOT_ID', ''), } # Custom sidebar templates, must be a dictionary that maps document names |
