mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-11-21 18:11:37 +01:00
Stop minfiying already minified resources
- Keeps the license text for 3rd party lib in place after generation
This commit is contained in:
parent
57dd5404d3
commit
e1a46046bc
@ -61,13 +61,13 @@
|
||||
{{- /* Search */}}
|
||||
{{- if (eq .Layout `search`) -}}
|
||||
<link crossorigin="anonymous" rel="preload" as="fetch" href="../index.json">
|
||||
{{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" site.Params.fuseOpts)) }}
|
||||
{{- $fastsearch := resources.Get "js/fastsearch.js" | js.Build (dict "params" (dict "fuseOpts" site.Params.fuseOpts)) | resources.Minify }}
|
||||
{{- $fusejs := resources.Get "js/fuse.basic.min.js" }}
|
||||
{{- if not site.Params.assets.disableFingerprinting }}
|
||||
{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify | fingerprint }}
|
||||
{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | fingerprint }}
|
||||
<script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}" integrity="{{ $search.Data.Integrity }}"></script>
|
||||
{{- else }}
|
||||
{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" | minify }}
|
||||
{{- $search := (slice $fusejs $fastsearch ) | resources.Concat "assets/js/search.js" }}
|
||||
<script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}"></script>
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
@ -76,11 +76,11 @@
|
||||
{{- $isHLJSdisabled := (site.Params.assets.disableHLJS | default .Params.disableHLJS ) }}
|
||||
{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }}
|
||||
{{- if not site.Params.assets.disableFingerprinting }}
|
||||
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify | fingerprint }}
|
||||
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | fingerprint }}
|
||||
<script defer crossorigin="anonymous" src="{{ $highlight.RelPermalink }}" integrity="{{ $highlight.Data.Integrity }}"
|
||||
onload="hljs.initHighlightingOnLoad();"></script>
|
||||
{{- else }}
|
||||
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify }}
|
||||
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" }}
|
||||
<script defer crossorigin="anonymous" src="{{ $highlight.RelPermalink }}" onload="hljs.initHighlightingOnLoad();"></script>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
Loading…
Reference in New Issue
Block a user