Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion docs/assets/scss/common/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1412,7 +1412,8 @@ body.home .site-footer {
margin-bottom: 0.375rem;
}

a {
a,
.footer-link-button {
color: var(--dd-dim-dark);
font-size: 0.875rem;
text-decoration: none;
Expand All @@ -1423,6 +1424,17 @@ body.home .site-footer {
text-decoration: none;
}
}

// "Cookie settings" reopens the consent banner, so it is a button styled
// to match the footer links.
.footer-link-button {
padding: 0;
border: 0;
background: none;
font-family: inherit;
line-height: inherit;
cursor: pointer;
}
}

.footer-social {
Expand Down
6 changes: 6 additions & 0 deletions docs/i18n/de.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ other = "Status"
[footer_link_support]
other = "Support"

[footer_link_privacy_policy]
other = "Datenschutzerklärung"

[footer_link_cookie_settings]
other = "Cookie-Einstellungen"

[footer_rights]
other = "Alle Rechte vorbehalten."

Expand Down
6 changes: 6 additions & 0 deletions docs/i18n/en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ other = "Status"
[footer_link_support]
other = "Support"

[footer_link_privacy_policy]
other = "Privacy policy"

[footer_link_cookie_settings]
other = "Cookie settings"

[footer_rights]
other = "All rights reserved."

Expand Down
6 changes: 6 additions & 0 deletions docs/i18n/es.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ other = "Estado"
[footer_link_support]
other = "Soporte"

[footer_link_privacy_policy]
other = "Política de privacidad"

[footer_link_cookie_settings]
other = "Configuración de cookies"

[footer_rights]
other = "Todos los derechos reservados."

Expand Down
6 changes: 6 additions & 0 deletions docs/i18n/fr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,12 @@ other = "Statut"
[footer_link_support]
other = "Support"

[footer_link_privacy_policy]
other = "Politique de confidentialité"

[footer_link_cookie_settings]
other = "Paramètres des cookies"

[footer_rights]
other = "Tous droits réservés."

Expand Down
6 changes: 6 additions & 0 deletions docs/i18n/it.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ other = "Stato"
[footer_link_support]
other = "Supporto"

[footer_link_privacy_policy]
other = "Informativa sulla privacy"

[footer_link_cookie_settings]
other = "Impostazioni dei cookie"

[footer_rights]
other = "Tutti i diritti riservati."

Expand Down
6 changes: 6 additions & 0 deletions docs/i18n/ja.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ other = "ステータス"
[footer_link_support]
other = "サポート"

[footer_link_privacy_policy]
other = "プライバシーポリシー"

[footer_link_cookie_settings]
other = "Cookie 設定"

[footer_rights]
other = "無断複製・転載を禁じます。"

Expand Down
6 changes: 6 additions & 0 deletions docs/i18n/pt-br.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ other = "Status"
[footer_link_support]
other = "Suporte"

[footer_link_privacy_policy]
other = "Política de privacidade"

[footer_link_cookie_settings]
other = "Configurações de cookies"

[footer_rights]
other = "Todos os direitos reservados."

Expand Down
6 changes: 6 additions & 0 deletions docs/i18n/zh-hans.toml
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,12 @@ other = "服务状态"
[footer_link_support]
other = "支持"

[footer_link_privacy_policy]
other = "隐私政策"

[footer_link_cookie_settings]
other = "Cookie 设置"

[footer_rights]
other = "保留所有权利。"

Expand Down
4 changes: 4 additions & 0 deletions docs/layouts/_partials/footer/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ <h6 class="footer-heading">{{ i18n "footer_heading_company" }}</h6>
<li><a href="https://trust.defectdojo.com" rel="noopener">{{ i18n "footer_link_trust_center" }}</a></li>
<li><a href="https://status.defectdojo.com" rel="noopener">{{ i18n "footer_link_status" }}</a></li>
<li><a href="mailto:support@defectdojo.com">{{ i18n "footer_link_support" }}</a></li>
<li><a href="https://defectdojo.com/privacy-policy" rel="noopener">{{ i18n "footer_link_privacy_policy" }}</a></li>
{{- if hugo.IsProduction }}
<li><button type="button" class="footer-link-button" onclick="(window._hsp = window._hsp || []).push(['showBanner'])">{{ i18n "footer_link_cookie_settings" }}</button></li>
{{- end }}
</ul>
</div>

Expand Down
112 changes: 102 additions & 10 deletions docs/layouts/_partials/head/script-header.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,104 @@
<!-- Insert scripts NOT needed by stylesheets here -->
<!-- Start of Reo Javascript -->
<script type="text/javascript">
!function(){var e,t,n;e="a92cfcfa51eca96",t=function(){Reo.init({clientID:"a92cfcfa51eca96"})},(n=document.createElement("script")).src="https://static.reo.dev/"+e+"/reo.js",n.defer=!0,n.onload=t,document.head.appendChild(n)}();
{{/*
Analytics and marketing tags load only after the visitor consents through the
HubSpot cookie banner (portal 22466695, which holds the banner policy for
docs.defectdojo.com). defectdojo.com follows the same rule. Before consent,
only the HubSpot script runs, and it shows the banner. Development builds
(hugo server) skip all of this so local previews never load trackers.

If the docs.defectdojo.com banner policy is ever removed in HubSpot, the
HubSpot script reports consent as granted by default, so keep that policy
enabled.
*/}}
{{ if hugo.IsProduction -}}
<script>
(function () {
window.dataLayer = window.dataLayer || [];
function gtag() { window.dataLayer.push(arguments); }
window.gtag = window.gtag || gtag;

// Google Consent Mode v2: everything is denied until the visitor accepts.
gtag('consent', 'default', {
ad_storage: 'denied',
ad_user_data: 'denied',
ad_personalization: 'denied',
analytics_storage: 'denied',
wait_for_update: 500
});

var loaded = { analytics: false, marketing: false };

function addScript(src, onload) {
var s = document.createElement('script');
s.src = src;
s.async = true;
if (onload) s.onload = onload;
document.head.appendChild(s);
}

// Same GA4 property defectdojo.com loads directly.
function loadAnalytics() {
if (loaded.analytics) return;
loaded.analytics = true;
addScript('https://www.googletagmanager.com/gtag/js?id=G-1WVHC6RCD2');
window.gtag('js', new Date());
window.gtag('config', 'G-1WVHC6RCD2', { anonymize_ip: true });
}

// The defectdojo.com tag container (Google Ads, LinkedIn Insight, Reddit,
// Apollo and GA4 events), plus Reo.
function loadMarketing() {
if (loaded.marketing) return;
loaded.marketing = true;
window.dataLayer.push({ 'gtm.start': new Date().getTime(), event: 'gtm.js' });
addScript('https://www.googletagmanager.com/gtm.js?id=GTM-5GRLWWW7');
addScript('https://static.reo.dev/a92cfcfa51eca96/reo.js', function () {
window.Reo.init({ clientID: 'a92cfcfa51eca96' });
});
}

// First-party cookies the tags above set: Google (_ga, _gid, _gcl_),
// Reddit (_rdt_), Reo (__sec_) and LinkedIn (li_, _li).
function clearCookies(pattern) {
var host = window.location.hostname;
var root = host.split('.').slice(-2).join('.');
document.cookie.split(';').forEach(function (pair) {
var name = pair.split('=')[0].trim();
if (!pattern.test(name)) return;
[host, '.' + root, ''].forEach(function (domain) {
document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/' +
(domain ? '; domain=' + domain : '');
});
});
}

var _hsp = window._hsp = window._hsp || [];
_hsp.push(['addPrivacyConsentListener', function (consent) {
var categories = consent.categories || {};
var analytics = !!(consent.allowed || categories.analytics);
var marketing = !!(consent.allowed || categories.advertisement);

window.gtag('consent', 'update', {
analytics_storage: analytics ? 'granted' : 'denied',
ad_storage: marketing ? 'granted' : 'denied',
ad_user_data: marketing ? 'granted' : 'denied',
ad_personalization: marketing ? 'granted' : 'denied'
});

// A script that is already running cannot be unloaded, so a withdrawal
// clears the tags' cookies and reloads the page, which then starts with
// nothing loaded.
if ((loaded.analytics && !analytics) || (loaded.marketing && !marketing)) {
clearCookies(/^(_ga|_gid|_gcl_|_rdt_|__sec_|li_|_li)/);
window.location.reload();
return;
}
// Reo loaded here without consent before this change; drop its cookies.
if (!marketing) clearCookies(/^__sec_/);
if (analytics) loadAnalytics();
if (marketing) loadMarketing();
}]);
})();
</script>
<!-- End of Reo Javascript -->
<script>function initApollo() {
var n = Math.random().toString(36).substring(7), o = document.createElement("script");
o.src = "https://assets.apollo.io/micro/website-tracker/tracker.iife.js?nocache=" + n, o.async = !0, o.defer = !0,
o.onload = function () { window.trackingFunctions.onLoad({ appId: "68ffca00b8c4dc001de5fec3" }) },
document.head.appendChild(o)
} initApollo();</script>
<script id="hs-script-loader" async defer src="https://js.hs-scripts.com/22466695.js"></script>
{{- end }}
Loading