1
0
Fork 0

Get everything together

This commit is contained in:
Carlos Mogas da Silva 2021-05-14 00:43:49 +01:00
parent 1be6b82419
commit 0e5c12ba90
7 changed files with 96 additions and 20 deletions

View file

@ -1,21 +1,8 @@
{{ if and (isset .Site.Params "matomo") (eq .Site.Params.matomo.enable true) }}
<script type="text/javascript">
window.addEventListener("load", function() {
t=Matomo.getTracker("{{- .Site.Params.matomo.url -}}", "{{- .Site.Params.matomo.id -}}");
when = t.getRememberedCookieConsent();
banner = document.getElementsByClassName("cookie-banner")[0];
if (when == 0) {
banner.style.display = 'block';
}
shouldShowPopup();
}, false);
function dismissPopup() {
t=Matomo.getTracker("{{- .Site.Params.matomo.url -}}", "{{- .Site.Params.matomo.id -}}");
t.rememberCookieConsentGiven()
banner = document.getElementsByClassName("cookie-banner")[0];
banner.style.display = 'none';
}
</script>
<div class="cookie-banner" style="display:none">
<p>{{ i18n "popupMsg" }}<a href="{{- .Site.Params.matomo.policyurl -}}"> <u>{{ i18n "cookiePolicy" }}</u></a>.</p>