mirror of
https://github.com/adityatelange/hugo-PaperMod.git
synced 2023-12-21 10:22:58 +01:00
Refactor, move HLJS code from footer to head;
already defered.
This commit is contained in:
parent
9d7576bd04
commit
bb7b6f0076
@ -17,7 +17,7 @@
|
||||
<main class="main">
|
||||
{{- block "main" . }}{{ end }}
|
||||
</main>
|
||||
{{ partialCached "footer.html" . .Type .Layout .Params -}}
|
||||
{{ partialCached "footer.html" . -}}
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -20,19 +20,7 @@
|
||||
</a>
|
||||
{{- end }}
|
||||
|
||||
{{- partial "extend_footer.html" . -}}
|
||||
|
||||
{{- $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 }}
|
||||
<script defer 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 }}
|
||||
<script defer src="{{ $highlight.RelPermalink }}" onload="hljs.initHighlightingOnLoad();"></script>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- partial "extend_footer.html" . }}
|
||||
|
||||
<script>
|
||||
window.onload = function () {
|
||||
|
@ -72,6 +72,20 @@
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{- /* Highlight.js */}}
|
||||
{{- $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 }}
|
||||
<script defer 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 }}
|
||||
<script defer src="{{ $highlight.RelPermalink }}" onload="hljs.initHighlightingOnLoad();"></script>
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- /* Favicons */}}
|
||||
<link rel="icon" href="{{ .Site.Params.assets.favicon | default "favicon.ico" | absURL }}">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="{{ .Site.Params.assets.favicon16x16 | default "favicon-16x16.png" | absURL }}">
|
||||
|
Loading…
Reference in New Issue
Block a user