fix highlight.js loading on section pages

This commit is contained in:
Aditya Telange 2021-01-15 23:21:13 +05:30
parent 18ae4e5593
commit ad44cdda0f
No known key found for this signature in database
GPG Key ID: 82E844EF3DA99E77

View File

@ -18,7 +18,7 @@
</a>
{{- partial "extend_footer.html" . -}}
{{- $isHLJSdisabled := (.Site.Params.assets.disableHLJS | default .Params.disableHLJS ) }}
{{- if (and (in site.Params.mainSections .Type) (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 }}
{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify | fingerprint }}
<script defer src="{{ $highlight.RelPermalink }}" integrity="{{ $highlight.Data.Integrity }}"