From bb7b6f00763709979f575d696e446387b8e2eb9a Mon Sep 17 00:00:00 2001 From: Aditya Telange <21258296+adityatelange@users.noreply.github.com> Date: Fri, 9 Apr 2021 19:36:09 +0530 Subject: [PATCH] Refactor, move HLJS code from footer to head; already defered. --- layouts/_default/baseof.html | 2 +- layouts/partials/footer.html | 14 +------------- layouts/partials/head.html | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html index 20c6fbf4..e53893da 100644 --- a/layouts/_default/baseof.html +++ b/layouts/_default/baseof.html @@ -17,7 +17,7 @@
{{- block "main" . }}{{ end }}
- {{ partialCached "footer.html" . .Type .Layout .Params -}} + {{ partialCached "footer.html" . -}} diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html index eb87737e..7f6e3a2c 100644 --- a/layouts/partials/footer.html +++ b/layouts/partials/footer.html @@ -20,19 +20,7 @@ {{- 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 }} - -{{- else }} -{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify }} - -{{- end }} -{{- end }} +{{- partial "extend_footer.html" . }} +{{- else }} +{{- $highlight := slice (resources.Get "js/highlight.min.js") | resources.Concat "assets/js/highlight.js" | minify }} + +{{- end }} +{{- end }} + {{- /* Favicons */}}