1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-03 15:16:40 -04:00

move dark mode script inline to avoid blinding flash of white background

This commit is contained in:
2021-05-28 11:11:09 -04:00
parent 4a59d3dd51
commit 468cc14d4b
5 changed files with 8 additions and 5 deletions

View File

@ -1,14 +1,13 @@
{{/* 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 -}}
{{- $bundle := slice $twemoji -}}
{{- if $includeProdScripts }}
{{- $fathom := resources.Get "js/fathom.js" | resources.ExecuteAsTemplate "js/fathom.js" . }}
{{- $bundle = slice $darkmode $twemoji $fathom }}
{{- $bundle = $bundle | append $fathom }}
{{- end }}
{{- $js := $bundle | resources.Concat "/js/app.js" -}}