7
1
mirror of https://gitlab.com/ansol/web-ansol.org.git synced 2024-10-23 08:10:35 +00:00
web-ansol.org/themes/academic/layouts/partials/cookie_consent.html

32 lines
1.4 KiB
HTML
Raw Normal View History

2020-06-11 11:46:16 +00:00
{{ if site.Params.privacy_pack }}
{{ $scr := .Scratch }}
{{ $js := site.Data.assets.js }}
{{ $css := site.Data.assets.css }}
{{ if ($scr.Get "use_cdn") }}
{{ printf "<script src=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\"></script>" (printf $js.cookieconsent.url $js.cookieconsent.version) $js.cookieconsent.sri | safeHTML }}
{{ printf "<link rel=\"stylesheet\" href=\"%s\" integrity=\"%s\" crossorigin=\"anonymous\">" (printf $css.cookieconsent.url $css.cookieconsent.version) $css.cookieconsent.sri | safeHTML }}
{{ end }}
<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://www.cookiesandyou.com"{{ end }}
}
})});
</script>
{{ end }}