mirror of
https://github.com/tiennm99/HugoBlox-kit.git
synced 2026-10-12 20:15:25 +00:00
fix: unminified JavaScript (#2305)
Appears that behavior of recent Hugo versions changed w.r.t. JS formatting
This commit is contained in:
1 parent
14aea8f8a3
commit
b860e6c775
1 file changed
+6
-6
@@ -137,16 +137,16 @@
|
||||
{{ range site.Params.plugins_js }}
|
||||
{{ $js_bundle = $js_bundle | append (resources.Get (printf "js/%s.js" .)) }}
|
||||
{{ end }}
|
||||
{{ $js_bundle := $js_bundle | resources.Concat (printf "%s/js/wowchemy-bundle.js" .Lang) }}
|
||||
{{ $js_bundle = $js_bundle | resources.Concat (printf "%s/js/wowchemy-bundle.js" .Lang) }}
|
||||
{{- if hugo.IsProduction -}}
|
||||
{{ $js_bundle = $js_bundle | minify }}
|
||||
{{- end -}}
|
||||
{{ $js_bundle := slice $js_bundle_head $js_bundle | resources.Concat (printf "%s/js/wowchemy.min.js" .Lang) }}
|
||||
{{- if hugo.IsProduction -}}
|
||||
{{- $js_bundle = $js_bundle | js.Build (dict "format" "iife") | fingerprint "md5" -}}
|
||||
{{- $js_bundle = $js_bundle | js.Build (dict "format" "iife") | minify -}}
|
||||
{{- else -}}
|
||||
{{- $js_bundle = $js_bundle | js.Build (dict "format" "iife" "sourceMap" "inline") -}}
|
||||
{{- end -}}
|
||||
{{ $js_bundle = slice $js_bundle_head $js_bundle | resources.Concat (printf "%s/js/wowchemy.min.js" .Lang) }}
|
||||
{{- if hugo.IsProduction -}}
|
||||
{{ $js_bundle = $js_bundle | fingerprint "md5" }}
|
||||
{{- end -}}
|
||||
<script src="{{ $js_bundle.RelPermalink }}"></script>
|
||||
|
||||
{{ partial "custom_js" . }}
|
||||
Reference in new issue
Block a user