1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-04-26 21:48:27 -04:00
Jake Jarvis f3198e0235
clean up a bunch of layouts, especially social-images function
also made even more config.toml parameters optional, will help when finally releasing theme
2020-06-25 10:35:59 -04:00

21 lines
875 B
HTML

{{- $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 -}}
{{/* only parse and append analytics script on production site */}}
{{- $includeAnalytics := eq hugo.Environment "production" -}}
{{- if $includeAnalytics }}
{{- $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>
{{/* proxy to simple analytics noscript on production */}}
{{- if $includeAnalytics }}
<noscript><img src="{{ "sa/manual.gif" | absURL }}" alt=""></noscript>
{{ end -}}