From 7b694613da1a07c3a1d5d755cc1d302ff3b0f224 Mon Sep 17 00:00:00 2001 From: ZhenShuo Leo <98386542+ZhenShuo2021@users.noreply.github.com> Date: Wed, 1 Oct 2025 13:37:23 +0800 Subject: [PATCH] refactor(head): remove unnecessary space trim --- layouts/partials/head.html | 60 +++++++++++++++++++------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 8ba05708..2e9105e4 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -8,21 +8,21 @@ {{/* Title */}} - {{ if .IsHome -}} + {{ if .IsHome }} {{ .Site.Title | emojify }} - {{- else -}} + {{ else }} {{ .Title | emojify }} · {{ .Site.Title | emojify }} - {{- end }} + {{ end }} {{/* Metadata */}} - {{ with (.Params.Summary | default .Params.Description) | default .Site.Params.description -}} + {{ with (.Params.Summary | default .Params.Description) | default .Site.Params.description }} - {{- end }} - {{ with .Params.Tags | default .Site.Params.keywords -}} - - {{- end }} + {{ end }} + {{ with .Params.Tags | default .Site.Params.keywords }} + + {{ end }} {{ with .Site.Params.robots }} {{ end }} @@ -30,12 +30,12 @@ {{ end }} - {{ range .AlternativeOutputFormats -}} + {{ range .AlternativeOutputFormats }} {{ printf ` ` .Rel .MediaType.Type .RelPermalink ($.Site.Title | emojify) | safeHTML }} - {{ end -}} + {{ end }} {{ $alg := .Site.Params.fingerprintAlgorithm | default "sha512" }} @@ -143,25 +143,25 @@ {{ template "_internal/opengraph.html" . }} {{ template "_internal/twitter_cards.html" . }} - {{- /* Main page always uses this; fallback elsewhere if no feature image */ -}} - {{- /* See https://gohugo.io/templates/embedded/#open-graph */ -}} - {{- $images := .Resources.ByType "image" -}} - {{- $socialImage := $images.GetMatch "*feature*" -}} + {{ /* Main page always uses this; fallback elsewhere if no feature image */ }} + {{ /* See https://gohugo.io/templates/embedded/#open-graph */ }} + {{ $images := .Resources.ByType "image" }} + {{ $socialImage := $images.GetMatch "*feature*" }} - {{- if not $socialImage -}} - {{- with .Site.Params.defaultSocialImage -}} - {{- if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") -}} - {{- $socialImage = resources.GetRemote . -}} - {{- else -}} - {{- $socialImage = resources.Get . -}} - {{- end -}} - {{- end -}} - {{- end -}} + {{ if not $socialImage }} + {{ with .Site.Params.defaultSocialImage }} + {{ if or (strings.HasPrefix . "http:") (strings.HasPrefix . "https:") }} + {{ $socialImage = resources.GetRemote . }} + {{ else }} + {{ $socialImage = resources.Get . }} + {{ end }} + {{ end }} + {{ end }} - {{- with $socialImage -}} + {{ with $socialImage }} - {{- end -}} + {{ end }} {{/* Schema */}} {{ partial "schema.html" . }} @@ -202,7 +202,7 @@ - + {{ end }} {{ end }}