From a8522ffe388547d1c2cfb1145fd35cf2e9043952 Mon Sep 17 00:00:00 2001
From: James Panther <4462786+jpanther@users.noreply.github.com>
Date: Mon, 23 Oct 2023 08:55:29 +1100
Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Refactor=20head=20partial?=
=?UTF-8?q?=20to=20better=20align=20to=20standards?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
layouts/partials/head.html | 64 +++++++++++++++++++++++++-------------
1 file changed, 43 insertions(+), 21 deletions(-)
diff --git a/layouts/partials/head.html b/layouts/partials/head.html
index 3f8a07ec..742b52ae 100644
--- a/layouts/partials/head.html
+++ b/layouts/partials/head.html
@@ -1,8 +1,6 @@
-
-
{{/* Title */}}
{{ if .IsHome -}}
{{ .Site.Title | emojify }}
@@ -11,24 +9,16 @@
{{ .Title | emojify }} · {{ .Site.Title | emojify }}
{{- end }}
- {{/* Metadata */}}
-
- {{ with union .Site.Params.keywords .Params.keywords -}}
-
- {{- end }}
- {{ with .Site.Params.robots }}
-
- {{ end }}
- {{ with .Params.robots }}
-
- {{ end }}
-
- {{ range .AlternativeOutputFormats -}}
- {{ printf `` .Rel .MediaType.Type .RelPermalink ($.Site.Title | emojify) | safeHTML }}
- {{ end -}}
{{/* Asset bundles */}}
{{ $assets := newScratch }}
{{ $algorithm := .Site.Params.fingerprintAlgorithm | default "sha256" }}
+ {{ $jsAppearance := resources.Get "js/appearance.js" }}
+ {{ $jsAppearance = $jsAppearance | resources.Minify | resources.Fingerprint $algorithm }}
+
{{ $cssScheme := resources.Get (printf "css/schemes/%s.css" (lower .Site.Params.colorScheme | default "congo")) }}
{{ if not $cssScheme }}
{{ $cssScheme = resources.Get "css/schemes/congo.css" }}
@@ -47,9 +37,6 @@
href="{{ $bundleCSS.RelPermalink }}"
integrity="{{ $bundleCSS.Data.Integrity }}"
/>
- {{ $jsAppearance := resources.Get "js/appearance.js" }}
- {{ $jsAppearance = $jsAppearance | resources.Minify | resources.Fingerprint $algorithm }}
-
{{ if .Site.Params.enableSearch | default false }}
{{ $jsFuse := resources.Get "lib/fuse/fuse.min.js" }}
{{ $jsSearch := resources.Get "js/search.js" }}
@@ -65,8 +52,42 @@
{{ end }}
{{ if $assets.Get "js" }}
{{ $bundleJS := $assets.Get "js" | resources.Concat "js/main.bundle.js" | resources.Minify | resources.Fingerprint $algorithm }}
-
+
{{ end }}
+ {{/* Metadata */}}
+
+ {{ with union .Site.Params.keywords .Params.keywords -}}
+
+ {{- end }}
+ {{ with .Site.Params.robots }}
+
+ {{ end }}
+ {{ with .Params.robots }}
+
+ {{ end }}
+
+ {{ range .AlternativeOutputFormats -}}
+ {{ printf `` .Rel .MediaType.Type .RelPermalink ($.Site.Title | emojify) | safeHTML }}
+ {{ end -}}
{{/* Icons */}}
{{ if templates.Exists "partials/favicons.html" }}
{{ partialCached "favicons.html" .Site }}
@@ -76,6 +97,7 @@
{{ end }}
+
{{/* Site Verification */}}
{{ with .Site.Params.verification.google }}