From a07b7bc1a03d74620acff0c91e7999953dddf888 Mon Sep 17 00:00:00 2001 From: Sped0n Date: Sun, 29 Oct 2023 00:59:26 +0800 Subject: [PATCH] fix(index.html): fix doctype declaration to use lowercase 'doctype' for HTML5 compliance fix(index.html): fix meta tag indentation for better readability fix(index.html): fix indentation of head and body tags for better readability fix(index.html): fix indentation of header, main, and footer sections for better readability fix(index.html): fix indentation of script tag for better readability fix(index.html): fix indentation of closing div tag for better readability fix(index.html): fix indentation of closing body and html tags for better readability feat(index.html): add partial for navigation bar to improve website navigation fix(head.html): fix indentation of esBuildOpts variable for better readability fix(head.html): fix indentation of script tag for better readability feat(nav.html): add navigation bar partial to improve website navigation --- layouts/index.html | 79 +++++++++++++++++++------------------- layouts/partials/head.html | 4 +- layouts/partials/nav.html | 27 +++++++++++++ 3 files changed, 68 insertions(+), 42 deletions(-) create mode 100644 layouts/partials/nav.html 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 "footer.html" . }} -
- +
+ {{ 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 @@ +