~alanorth/hugo-theme-bootstrap4-blog

ref: 5797675dbda6a2a0d7f0739daadfdec01aa8f621 hugo-theme-bootstrap4-blog/layouts/partials/cookie-consent.html -rw-r--r-- 1.2 KiB
5797675d — Alan Orth theme.toml: Add demo link 10 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
{{ $cookieConsentScript := resources.Get "js/haven.umd.min.js" | resources.Fingerprint }}
<script src="{{ $cookieConsentScript.Permalink }}"{{ if not .Site.Params.disable_sri }} integrity="{{ $cookieConsentScript.Data.Integrity }}" crossorigin="anonymous"{{ end }}></script>

<script>
Haven.create({
    notification: {
        {{ with .Site.Params.cookie_consent_info_url -}}
        policyUrl: {{ . | absURL }},
        {{- end }}
        styles: {
            background: '#428bca',
            textColor: '#ffffff',
            buttonBackgroundColor: '#f71559',
            buttonTextColor: '#ffffff',
        },
    },
    translations: {
      {{ .Lang }}: {
            notification: {
                policy: '{{ i18n "cookieLink" }}',
                message: '{{ i18n "cookieMessage" }}',
                accept: '{{ i18n "cookieAccept" }}',
                decline: '{{ i18n "cookieDecline" }}',
            }
        },
    },
    services: [
        {
            name: 'google-analytics',
            options: {
                    id: {{ .Site.GoogleAnalytics }},
            },
            purposes: ['analytics'],
            inject: true,
        }
    ]
});
</script>

{{- /* vim: set ts=2 sw=2 et: */}}