From ddcd0cdcd38735f15b933099be85446ad5b364d2 Mon Sep 17 00:00:00 2001
From: weru <fromweru@gmail.com>
Date: Sun, 14 Jan 2024 13:18:01 +0000
Subject: [PATCH] edit whitespace #120

---
 layouts/partials/nav.html              |   12 +++---
 layouts/_default/term.html             |   19 +++++----
 layouts/partials/opengraph.html        |    2 
 layouts/partials/head/liteyoutube.html |   40 ++++++++++----------
 layouts/blog/list.html                 |   19 +++++----
 5 files changed, 47 insertions(+), 45 deletions(-)

diff --git a/layouts/_default/term.html b/layouts/_default/term.html
index de6ff3e..ffb2cf3 100644
--- a/layouts/_default/term.html
+++ b/layouts/_default/term.html
@@ -1,18 +1,18 @@
 {{ define "main" }}
 {{- $pages := .Data.Pages }}
-{{ .Data.Terms }}
+{{- .Data.Terms }}
 <div class="wrap pt-2 mt-2">
   {{- $paginator := .Paginate $pages -}}
   {{- $size := $paginator.PageSize }}
   {{- $scratch := newScratch }}
   {{- range $index, $value := $paginator.Pages }}
-    {{ if isset .Params "image" }}
-      {{ $scratch.Set "image" .Params.image }}
-    {{ else }}
-      {{ $scratch.Set "image" "thumbnail.svg" }}
-    {{ end }}
-    {{ $image := $scratch.Get "image" }}
-    {{ $bg := (absURL (printf "images/%s" $image)) }}
+    {{- if isset .Params "image" }}
+      {{- $scratch.Set "image" .Params.image }}
+    {{- else }}
+      {{- $scratch.Set "image" "thumbnail.svg" }}
+    {{- end }}
+    {{- $image := $scratch.Get "image" }}
+    {{- $bg := (absURL (printf "images/%s" $image)) }}
     {{- if in $image "https://" }}
       {{- $bg = $image }}
     {{- end }}
@@ -32,4 +32,5 @@
   {{- if and (eq $index (add $size -1)) (gt $size 1) }}</div>{{ end }}
   {{- end }}
 </div>
-{{ end }}
+</div>
+{{- end -}}
diff --git a/layouts/blog/list.html b/layouts/blog/list.html
index 1e59c3f..761cf09 100644
--- a/layouts/blog/list.html
+++ b/layouts/blog/list.html
@@ -5,15 +5,15 @@
   {{- $size := $paginator.PageSize }}
   {{- $scratch := newScratch }}
   {{- range $index, $value := $paginator.Pages }}
-    {{ if isset .Params "image" }}
-      {{ $scratch.Set "image" .Params.image }}
-    {{ else }}
-      {{ $scratch.Set "image" "thumbnail.svg" }}
-    {{ end }}
-    {{ $image := $scratch.Get "image" }}
-    {{ $bg := $image }}
+    {{- if isset .Params "image" }}
+      {{- $scratch.Set "image" .Params.image }}
+    {{- else }}
+      {{- $scratch.Set "image" "thumbnail.svg" }}
+    {{- end }}
+    {{- $image := $scratch.Get "image" }}
+    {{- $bg := $image }}
     {{- if ne (in $image "images") true }}
-      {{ $bg = (absURL (printf "images/%s" $image)) }}
+      {{- $bg = (absURL (printf "images/%s" $image)) }}
     {{- end }}
     {{- if in $image "https://" }}
       {{- $bg = $image }}
@@ -34,6 +34,7 @@
   {{- if and (eq $index (add $size -1)) (gt $size 1) }}</div>{{ end }}
   {{- end }}
 </div>
+</div>
 <!-- <a href='{{ absURL (printf "post/%s" "") }}' class=post_nav>
   <span class=post_next>View Archive
   <svg class="icon icon_scale">
@@ -41,4 +42,4 @@
   </svg>
   </span>
 </a> -->
-{{ end }}
+{{- end }}
diff --git a/layouts/partials/head/liteyoutube.html b/layouts/partials/head/liteyoutube.html
index 59a006d..feecbf1 100644
--- a/layouts/partials/head/liteyoutube.html
+++ b/layouts/partials/head/liteyoutube.html
@@ -1,24 +1,24 @@
-{{ $baseurl := absURL "" }}
-{{ $includeLiteYT := false }}
+{{- $baseurl := absURL "" }}
+{{- $includeLiteYT := false }}
 <!-- begin search for liteyoutube shortcode. code borrowed from erichc Nov 2020 https://discourse.gohugo.io/t/automagically-loading-suitable-scripts-in-head/29429/8 -->
-{{ if .IsNode }}
-  {{ range .Pages }}
-    {{ range .Pages }}
+{{- if .IsNode }}
+  {{- range .Pages }}
+    {{- range .Pages }}
     <!-- another recursion because of the "/posts/xyz" structure; does work with category lists -->
-      {{ $rawsummary := split .RawContent "<!--more-->" }}
+      {{- $rawsummary := split .RawContent "<!--more-->" }}
       <!-- prepare for checking only the part of the article that will show up on the list page -->
-      {{ if (findRE "liteyoutube" (index $rawsummary 0)) }}
-        {{ $includeLiteYT = true }}
-      {{ end }}
-    {{ end }}
-  {{ end }}
-{{ end }}
-{{ if (.HasShortcode "liteyoutube") }}
-  {{ $includeLiteYT = true }}
-{{ end }}
-{{ if $includeLiteYT }}
-  {{ $styles := printf "%s/css/lite-yt-embed.css" $baseurl }}
-  {{ $scripts := printf "%s/js/lite-yt-embed.js" $baseurl }}
-  <link rel="stylesheet" href={{ $styles }}>
+      {{- if (findRE "liteyoutube" (index $rawsummary 0)) }}
+        {{- $includeLiteYT = true }}
+      {{- end }}
+    {{- end }}
+  {{- end }}
+{{- end }}
+{{- if (.HasShortcode "liteyoutube") }}
+  {{- $includeLiteYT = true }}
+{{- end }}
+{{- if $includeLiteYT }}
+  {{- $styles := printf "%s/css/lite-yt-embed.css" $baseurl }}
+  {{- $scripts := printf "%s/js/lite-yt-embed.js" $baseurl }}
+  <link rel=stylesheet href={{ $styles }}>
   <script src={{ $scripts }}></script>
-{{ end }}
\ No newline at end of file
+{{- end -}}
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index 698c6c4..92f322b 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -8,7 +8,7 @@
 			<img src="{{ $litPath }}" alt="{{ site.Title }} Logo">
 		</picture>
 		<div class="nav_toggle toggle" title='{{ T "site_menu" }}'>
-			{{ partial "sprite" (dict "icon" "harmburger") }}
+			{{- partial "sprite" (dict "icon" "harmburger") }}
 		</div>
 	</a>
 	<ul class="nav_body">
@@ -29,20 +29,20 @@
 			<a class="nav-link{{if $active }} active{{end}}" href="{{ $url }}"><span{{if $active }} class="active"{{end}}>{{ T .Identifier | default .Name }}</span></a>
 		</li>
 		{{- end }}
-		{{ $repo := $config.source }}
-		{{ with $config.source }}
+		{{- $repo := $config.source }}
+		{{- with $config.source }}
 		<li class="nav-item nav_repo">
 			<a class="nav-link" href="{{ .url }}" target="_blank">
-				{{ if .iconLight }}
+				{{- if .iconLight }}
 					{{- $litPath := absURL .iconLight }}
 					{{- $darkPath := absURL .iconDark }}
 					<picture data-lit="{{ $litPath }}" data-dark="{{ $darkPath }}">
 						<img src="{{ $litPath }}" alt="{{ .name }} Repo">
 					</picture>
-				{{ else }}{{ .name }}{{ end }}
+				{{- else }}{{ .name }}{{ end }}
 			</a>
 		</li>
-		{{ end }}
+		{{- end }}
 		<li class="nav-item">{{ partial "mode" . }}</li>
 	</ul>
 </nav>
diff --git a/layouts/partials/opengraph.html b/layouts/partials/opengraph.html
index 9b47eba..3ad80f8 100644
--- a/layouts/partials/opengraph.html
+++ b/layouts/partials/opengraph.html
@@ -3,4 +3,4 @@
 {{- template "_internal/twitter_cards.html" . -}}
 {{- if hugo.IsProduction }}
   {{- template "_internal/google_analytics.html" . }}
-{{- end }}
+{{- end -}}

--
Gitblit v1.10.0