{{- partial "plausible_check.html" . }}
{{- if site.Params.plausible }}
{{ "" | safeHTML }}
{{- if (site.Params.plausible.enable) }}
{{- "" | safeHTML }}
{{- if site.Params.plausible.custom_js_domain }}
{{- else }}
{{- end }}
{{- end }}
{{- $scriptname := "plausible" }}
{{- $scriptname_custom := "index" }}
{{- if site.Params.plausible.outbound_link }}
{{- $scriptname = "plausible.outbound-links" }}
{{- $scriptname_custom = "index.outbound-links" }}
{{- end }}
{{- if and (site.Params.plausible.enable) (not .Params.plausible_do_not_track) }}
{{- if and (site.IsServer) (not site.Params.plausible.debug) -}}
{{- printf "" | safeHTML }}
{{- else }}
{{- if site.Params.plausible.custom_js_domain }}
{{- else }}
{{- end }}
{{- end }}
{{- $seed := now.Format "2006-01-02" }}
{{- $nonce_base := delimit (shuffle (split (md5 $seed) "" )) "" }}
{{ .Scratch.Set "nonce_base" $nonce_base }}
{{ "" | safeHTML }}
{{- $seed := now.Format "2006-01-02 15:04" }}
{{- $nonce := delimit (shuffle (split (md5 $seed) "" )) "" }}
{{ .Scratch.Set "nonce" $nonce }}
{{- $v_csp := "" }}
{{- if site.Params.plausible.custom_js_domain }}
{{- $v_csp = site.Params.plausible.custom_js_domain }}
{{- else }}
{{- $v_csp = default "plausible.io" site.Params.plausible.selfhosted_domain }}
{{- end }}
{{ printf "" | safeHTML }}
{{- if site.Params.plausible.public_dashboard }}
{{- $dashboard_url := default "plausible.io" site.Params.plausible.selfhosted_domain }}
{{- $dashboard_url = printf "%s/%s" $dashboard_url site.Params.plausible.domain }}
{{- printf "" $dashboard_url | safeHTML }}
{{- end }}
{{- end }}
{{ "" | safeHTML }}
{{- end }}