diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html new file mode 100644 index 0000000..729a235 --- /dev/null +++ b/layouts/_default/baseof.html @@ -0,0 +1,17 @@ + + + + + + {{ .Title }} + {{- partial "head/link.html" -}} + {{- partial "head/meta.html" -}} + {{- partial "head/seo.html" -}} + + +
+ {{- block "main" . -}} + {{- end -}} +
+ + diff --git a/layouts/_default/single.html b/layouts/_default/single.html new file mode 100644 index 0000000..622601d --- /dev/null +++ b/layouts/_default/single.html @@ -0,0 +1,14 @@ +{{- define "main" -}} + {{- $params := .Scratch.Get "params" -}} + {{- $currentPage := . -}} + {{- with partial "function/currentMenuItem.html" . -}} + {{- partial "resources/imageJSON.html" (dict "Path" .Name "Page" $currentPage) -}} + + {{- end -}} +
+ {{- partial "nav.html" . -}} +
+
+ {{ .Content }} +
+{{- end -}} diff --git a/layouts/index.html b/layouts/index.html deleted file mode 100644 index 5e9a693..0000000 --- a/layouts/index.html +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - {{ 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 }} -
-
{{ partial "nav.html" . }}
- - diff --git a/layouts/partials/footer.html b/layouts/partials/footer.html deleted file mode 100644 index 6029f5d..0000000 --- a/layouts/partials/footer.html +++ /dev/null @@ -1,24 +0,0 @@ - - - - \ No newline at end of file diff --git a/layouts/partials/head.html b/layouts/partials/head.html deleted file mode 100644 index 44d92c6..0000000 --- a/layouts/partials/head.html +++ /dev/null @@ -1,13 +0,0 @@ -{{- $fingerprint := .Scratch.Get "fingerprint" | default "" -}} -{{- $style := dict "Source" "scss/style.scss" "Fingerprint" $fingerprint -}} -{{- $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 $esBuildOpts -}} - - diff --git a/layouts/partials/head/link.html b/layouts/partials/head/link.html new file mode 100644 index 0000000..e890346 --- /dev/null +++ b/layouts/partials/head/link.html @@ -0,0 +1,27 @@ +{{/* fingerprint */}} +{{- $fingerprint := .Scratch.Get "fingerprint" | default "" -}} + +{{/* main style */}} +{{- $style := dict "Source" "scss/style.scss" "Fingerprint" $fingerprint -}} +{{- $options := dict "targetPath" "css/style.min.css" "enableSourceMap" true -}} +{{- $style = dict "Context" . "ToCSS" $options | merge $style -}} +{{- partial "plugin/style.html" $style -}} + +{{/* swiper css */}} +{{- $style := dict "Source" "/lib/swiper/swiper-bundle.min.css" "Fingerprint" $fingerprint -}} +{{- partial "plugin/style.html" $style -}} + +{{/* main js */}} +{{- $esBuildOpts := dict "minify" hugo.IsProduction -}} +{{- $js := resources.Get "ts/main.ts" | js.Build $esBuildOpts -}} +{{- $script := dict "Source" $js.Permalink "Fingerprint" $fingerprint "Defer" true -}} +{{- partial "plugin/script.html" $script -}} + +{{/* fonts */}} + diff --git a/layouts/partials/head/meta.html b/layouts/partials/head/meta.html new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/layouts/partials/head/meta.html @@ -0,0 +1 @@ + diff --git a/layouts/partials/header.html b/layouts/partials/head/seo.html similarity index 100% rename from layouts/partials/header.html rename to layouts/partials/head/seo.html diff --git a/layouts/partials/mobile_wrapper.html b/layouts/partials/mobile_wrapper.html deleted file mode 100644 index 940371f..0000000 --- a/layouts/partials/mobile_wrapper.html +++ /dev/null @@ -1,6 +0,0 @@ -
- {{ $sourcePath := "images" }} - {{ $gallery := site.GetPage $sourcePath }} - {{ with $gallery.Resources.ByType "image" }} - {{ end }} -
\ No newline at end of file diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html index f1b9a4a..d1fb87d 100644 --- a/layouts/partials/nav.html +++ b/layouts/partials/nav.html @@ -3,10 +3,18 @@ Bridget Baker
Threshold: