Join lines in head for hljs assets (#360)

Fixes errors in lower hugo versions

Error: add site dependencies: load resources: loading templates: "site/themes/hugo-PaperMod/layouts/partials/head.html:79:1": parse failed: template: partials/head.html:79: unexpected unclosed action in command
This commit is contained in:
Cody Brownstein 2021-04-15 21:23:18 -07:00 committed by GitHub
parent a015ec2efc
commit c3634e6ccd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -76,8 +76,7 @@
{{- $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 | {{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify | fingerprint }}
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 }}