mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-07-03 15:16:40 -04:00
27 lines
1.1 KiB
HTML
27 lines
1.1 KiB
HTML
{{/* only parse and append analytics script on production site */}}
|
|
{{- $includeProdScripts := eq hugo.Environment "production" -}}
|
|
|
|
{{- $darkmode := resources.Get "js/dark-mode.js" | resources.ExecuteAsTemplate "js/dark-mode.js" . -}}
|
|
{{- $twemoji := resources.Get "js/vendor/twemoji.js" | resources.ExecuteAsTemplate "js/vendor/twemoji.js" . -}}
|
|
|
|
{{- $bundle := slice $darkmode $twemoji -}}
|
|
|
|
{{- if $includeProdScripts }}
|
|
{{- $analytics := resources.Get "js/analytics.js" | resources.ExecuteAsTemplate "js/analytics.js" . }}
|
|
{{- $bundle = slice $darkmode $twemoji $analytics }}
|
|
{{- end }}
|
|
|
|
{{- $js := $bundle | resources.Concat "/js/app.js" -}}
|
|
<script async defer src="{{ $js.Permalink }}"></script>
|
|
|
|
{{ if eq .Page.RelPermalink "/search/" }}
|
|
{{- $algolia := resources.Get "js/vendor/algolia.js" -}}
|
|
{{- $algoliaConfig := resources.Get "js/search.js" -}}
|
|
{{- $searchJS := slice $algolia $algoliaConfig | resources.Concat "/js/search.js" -}}
|
|
<script async defer src="{{ $searchJS.Permalink }}"></script>
|
|
{{ end }}
|
|
|
|
{{- if $includeProdScripts }}
|
|
<script async defer src="https://manatee.jarv.is/script.js" data-site="PPSQZUDY"></script>
|
|
{{ end }}
|