hook_test/layouts/partials/cookie_consent.html
2021-12-31 12:44:26 +01:00

28 lines
1.1 KiB
HTML

{{ if site.Params.privacy_pack }}
{{ $scr := .Scratch }}
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
<script>
window.addEventListener("load", function(){
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "{{ $scr.Get "primary" }}",
"text": "{{ $scr.Get "background" }}"
},
"button": {
"background": "{{ $scr.Get "background" }}",
"text": "{{ $scr.Get "primary" }}"
}
},
"theme": "classic",
"content": {
"message": {{ i18n "cookie_message" | default "This website uses cookies to ensure you get the best experience on our website." }},
"dismiss": {{ i18n "cookie_dismiss" | default "Got it!" }},
"link": {{ i18n "cookie_learn" | default "Learn more" }},
"href": {{ with site.GetPage "privacy.md" }}{{ printf "%s" .RelPermalink }}{{ else }}"https://cookies.insites.com"{{ end }}
}
})});
</script>
{{ end }}