mirror of
https://github.com/alanorth/hugo-theme-bootstrap4-blog.git
synced 2024-12-19 09:02:18 +01:00
Alan Orth
a81ed6803b
Some sites using edge caching like that on a CDN or S3 might have issues with assets being cached too long, causing user agents to refuse to load assets due to SRI hash mismatch. These sites should disable the use of sub-resource integrity hashes using this config option in their config: disable_sri = true
27 lines
972 B
HTML
27 lines
972 B
HTML
<link href="{{ .Site.BaseURL }}css/cookieconsent.min.css" rel="stylesheet" type="text/css"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.cookieconsentcss }}" crossorigin="anonymous"{{ end }}>
|
|
<script src="{{ .Site.BaseURL }}js/cookieconsent.min.js"{{ if not .Site.Params.disable_sri }} integrity="{{ .Site.Data.sri.cookieconsentjs }}" crossorigin="anonymous"{{ end }} async></script>
|
|
|
|
<script>
|
|
window.addEventListener("load", function(){
|
|
window.cookieconsent.initialise({
|
|
"palette": {
|
|
"popup": {
|
|
"background": "#428bca",
|
|
"text": "#ffffff"
|
|
},
|
|
"button": {
|
|
"background": "#f71559"
|
|
}
|
|
},
|
|
"content": {
|
|
"message": '{{ i18n "cookieMessage" }}',
|
|
"dismiss": '{{ i18n "cookieDismiss" }}',
|
|
"link": '{{ i18n "cookieLink" }}',
|
|
"href": "{{ .Site.Params.cookie_consent_info_url | absURL}}"
|
|
},
|
|
"position": "bottom-right"
|
|
})});
|
|
</script>
|
|
|
|
{{- /* vim: set ts=2 sw=2 et: */}}
|