Files
bridget/layouts/index.html
Sped0n a07b7bc1a0 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
2023-10-29 00:59:26 +08:00

43 lines
1.3 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{{ partial "head.html" . }}
<title>{{ .Title }}</title>
</head>
<body>
<header>
{{ partial "header.html" . }}
</header>
<div id="main">
{{ $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 }}
<script id="imagesSource" type="application/json">{{ $.Scratch.Get "img" | jsonify | safeJS }}</script>
{{ end }}
</div>
{{ partial "nav.html" . }}
</body>
</html>