mirror of
https://github.com/Wonderfall/hugo-WonderMod.git
synced 2024-11-22 10:31:39 +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">
|
<main class="main">
|
||||||
{{- block "main" . }}{{ end }}
|
{{- block "main" . }}{{ end }}
|
||||||
</main>
|
</main>
|
||||||
{{ partialCached "footer.html" . .Type .Layout .Params -}}
|
{{ partialCached "footer.html" . -}}
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -20,19 +20,7 @@
|
|||||||
</a>
|
</a>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
{{- partial "extend_footer.html" . -}}
|
{{- 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 }}
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
window.onload = function () {
|
window.onload = function () {
|
||||||
|
@ -72,6 +72,20 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
{{- 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 */}}
|
{{- /* Favicons */}}
|
||||||
<link rel="icon" href="{{ .Site.Params.assets.favicon | default "favicon.ico" | absURL }}">
|
<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 }}">
|
<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