mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2024-12-28 07:45:51 -05: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 */}}
|
{{- /* Search */}}
|
||||||
{{- if (eq .Layout `search`) -}}
|
{{- if (eq .Layout `search`) -}}
|
||||||
<link crossorigin="anonymous" rel="preload" as="fetch" href="../index.json">
|
<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" }}
|
{{- $fusejs := resources.Get "js/fuse.basic.min.js" }}
|
||||||
{{- if not site.Params.assets.disableFingerprinting }}
|
{{- 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>
|
<script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}" integrity="{{ $search.Data.Integrity }}"></script>
|
||||||
{{- else }}
|
{{- 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>
|
<script defer crossorigin="anonymous" src="{{ $search.RelPermalink }}"></script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
@ -76,11 +76,11 @@
|
|||||||
{{- $isHLJSdisabled := (site.Params.assets.disableHLJS | default .Params.disableHLJS ) }}
|
{{- $isHLJSdisabled := (site.Params.assets.disableHLJS | default .Params.disableHLJS ) }}
|
||||||
{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }}
|
{{- if (and (eq .Kind "page") (ne .Layout "archives") (ne .Layout "search") (not $isHLJSdisabled)) }}
|
||||||
{{- if not site.Params.assets.disableFingerprinting }}
|
{{- 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 }}"
|
<script defer crossorigin="anonymous" src="{{ $highlight.RelPermalink }}" integrity="{{ $highlight.Data.Integrity }}"
|
||||||
onload="hljs.initHighlightingOnLoad();"></script>
|
onload="hljs.initHighlightingOnLoad();"></script>
|
||||||
{{- else }}
|
{{- 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>
|
<script defer crossorigin="anonymous" src="{{ $highlight.RelPermalink }}" onload="hljs.initHighlightingOnLoad();"></script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user