I would like to add a cookie message to inform readers that my blog is using cookies. I am using hugo blogdown with the "tranquilpeak" theme. Unfortunately, this theme doesn't have the privacy pack implemented yet, so I tried to add the infos which are used in the "academic" theme from this site. I added:
privacy_pack = true
to "config.toml". Created the "cookie_consent.html" file with
{{ if .Site.Params.privacy_pack }}
<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": "#000"
},
"button": {
"background": "#f1d600"
}
},
"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" }}
}
})});
</script>
{{ end }}
and than I added:
{{ partial "cookie_consent.html" . }}
to the file "header.html". Unfortunately the cookie statement is not showing up and I don't know where to start searching for the reason. Any help is appreciated.