mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-14 10:09:31 -07:00
45 lines
1.2 KiB
HTML
45 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="utf-8"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
{{ 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" (string $index)
|
|
"url" (string .RelPermalink)
|
|
"imgH" (string .Height)
|
|
"imgW" (string .Width)
|
|
"pColor" (string $pColor)
|
|
"sColor" (string $sColor)) }}
|
|
{{ end }}
|
|
<script id="images_array" type="application/json">{{ $.Scratch.Get "img" | jsonify | safeJS }}</script>
|
|
{{ end }}
|
|
{{ partial "desktop_wrapper.html" . }}
|
|
</div>
|
|
<footer>
|
|
{{ partial "footer.html" . }}
|
|
</footer>
|
|
</body>
|
|
</html>
|