mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-04-27 21:30:30 -04:00
20 lines
871 B
HTML
20 lines
871 B
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>
|
|
|
|
{{- $algolia := resources.Get "js/vendor/algolia.js" -}}
|
|
{{- $searchJS := slice $algolia | resources.Concat "/js/search.js" -}}
|
|
<!-- {{ $searchJS.Permalink }} -->
|