+ {{ $sourcePath := "images" }}
+ {{ $gallery := site.GetPage $sourcePath }}
+ {{ with $gallery.Resources.ByType "image" }}
+ {{ $index := len . }}
+ {{ $.Scratch.Add "img" slice }}
+ {{ range . }}
+ {{ $index = sub $index 1 }}
+ {{ $colors := .Colors }}
+ {{ $pColor := index $colors 0 }}
+ {{ $sColor := "#ccc" }}
+ {{ if gt (len $colors) 1 }}
+ {{ $sColor = index $colors 1 }}
+ {{ end }}
+ {{ $resize := .Resize "x2000 webp Lanczos q70" }}
+ {{ $.Scratch.Add "img" (dict
+ "index" (int $index)
+ "url" (string .RelPermalink)
+ "imgH" (int .Height)
+ "imgW" (int .Width)
+ "pColor" (string $pColor)
+ "sColor" (string $sColor))
+ }}
+ {{ end }}
+
{{ end }}
- {{ $resize := .Resize "x2000 webp Lanczos q70" }}
- {{ $.Scratch.Add "img" (dict
- "index" (string $index)
- "url" (string .RelPermalink)
- "imgH" (string .Height)
- "imgW" (string .Width)
- "pColor" (string $pColor)
- "sColor" (string $sColor)) }}
- {{ end }}
-
- {{ end }}
-
-
-
+