cookie_consent.html 1.1 KB

123456789101112131415161718192021222324252627
  1. {{ if .Site.Params.privacy_pack }}
  2. {{ $scr := .Scratch }}
  3. <link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.css">
  4. <script src="//cdnjs.cloudflare.com/ajax/libs/cookieconsent2/3.0.3/cookieconsent.min.js"></script>
  5. <script>
  6. window.addEventListener("load", function(){
  7. window.cookieconsent.initialise({
  8. "palette": {
  9. "popup": {
  10. "background": "{{ $scr.Get "primary" }}",
  11. "text": "{{ $scr.Get "background" }}"
  12. },
  13. "button": {
  14. "background": "{{ $scr.Get "background" }}",
  15. "text": "{{ $scr.Get "primary" }}"
  16. }
  17. },
  18. "theme": "classic",
  19. "content": {
  20. "message": {{ i18n "cookie_message" | default "This website uses cookies to ensure you get the best experience on our website." }},
  21. "dismiss": {{ i18n "cookie_dismiss" | default "Got it!" }},
  22. "link": {{ i18n "cookie_learn" | default "Learn more" }},
  23. "href": {{ with .Site.GetPage "privacy.md" }}{{ printf "%s" .RelPermalink }}{{ else }}"https://cookies.insites.com"{{ end }}
  24. }
  25. })});
  26. </script>
  27. {{ end }}