{{ $buildOptions := dict "minify" true "target" "es2015" }} {{ if .IsHome }} {{ $scripts := slice }} {{ $scripts = $scripts | append (resources.Get "js/src/base.js") }} {{ if .Site.Params.Feat.useTermynal -}} {{ $scripts = $scripts | append (resources.Get "js/src/termynal.js" | resources.ExecuteAsTemplate "js/src/termynal.js" .) }} {{- end }} {{ if not (eq (len (where .Site.RegularPages "Section" "gallery")) 0) -}} {{ $scripts = $scripts | append (resources.Get "js/src/modal.js" | resources.ExecuteAsTemplate "js/src/modal.js" .) }} {{- end }} {{ $scripts = $scripts | append (resources.Get "js/src/nav.js" | resources.ExecuteAsTemplate "js/src/nav.js" .) }} {{ $scripts = $scripts | append (resources.Get "js/src/blogposts.js" | resources.ExecuteAsTemplate "js/src/blogposts.js" .) }} {{ $scripts = $scripts | append (resources.Get "js/src/home.js") }} {{ if (.Site.Params.Feat.contactAPI) -}} {{ $scripts = $scripts | append (resources.Get "js/src/contact.js" | resources.ExecuteAsTemplate "js/src/contact.js" .) }} {{- end }} {{ $content := ($scripts | resources.Concat "js/bundle-home.js" | js.Build $buildOptions).Content }} {{ if (gt (len $content) 6144) -}} {{ warnf "Performance: inlined JS is %dKB" (len $content) }} {{- end }} {{- else -}} {{ $scripts := slice (resources.Get "js/src/base.js") (resources.Get "js/src/nav.js") }} {{ $content := ($scripts | resources.Concat "js/bundle-blog.js" | js.Build $buildOptions).Content }} {{ end }} {{ partial "icon-data" . }}