diff --git a/layouts/index.html b/layouts/index.html index 03e0fdc..9fe8cfc 100644 --- a/layouts/index.html +++ b/layouts/index.html @@ -1,43 +1,42 @@ - + - - - - {{ partial "head.html" . }} - {{ .Title }} - - -
- {{ partial "header.html" . }} -
-
- {{ $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 }} + + + + {{ partial "head.html" . }} + {{ .Title }} + + +
+ {{ partial "header.html" . }} +
+
+ {{ $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 }} -
- - +
+ {{ partial "nav.html" . }} + diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 555b9aa..c3d84e6 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -3,7 +3,7 @@ {{- $options := dict "targetPath" "css/style.min.css" "enableSourceMap" true -}} {{- $style = dict "Context" . "ToCSS" $options | merge $style -}} {{- partial "plugin/style.html" $style -}} +{{- $esBuildOpts := dict "minify" hugo.IsProduction -}} -{{ $script := resources.Get "ts/main.ts" | js.Build }} +{{- $script := resources.Get "ts/main.ts" | js.Build $esBuildOpts -}} - diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html new file mode 100644 index 0000000..f1b9a4a --- /dev/null +++ b/layouts/partials/nav.html @@ -0,0 +1,27 @@ +