Files
bridget/layouts/partials/resources/imageJSON.html
Sped0n df5d839074 chore(link.html): update critical style source and options to improve performance and maintainability
chore(link.html): update main style source and options to improve performance and maintainability
chore(link.html): remove unused meta.html file
chore(nav.html): update decrement and increment buttons to use Unicode characters for better accessibility
chore(plugin/style.html): update style plugin to support inline styles for critical CSS
chore(plugin/style.html): update style plugin to support minification and fingerprinting for main CSS
chore(plugin/style.html): remove script plugin as it is no longer used
chore(plugin/style.html): update style plugin to support inline styles for critical CSS
chore(plugin/style.html): update style plugin to support minification and fingerprinting for main CSS
chore(resources/imageJSON.html): update image resize options for better performance and quality
2023-11-01 23:09:53 +08:00

24 lines
762 B
HTML

{{- $Page := .Page -}}
{{ $gallery := site.GetPage .Path }}
{{ with $gallery.Resources.ByType "image" }}
{{ $index := len . }}
{{ $Page.Scratch.Add "img" slice }}
{{ range . }}
{{ $index = sub $index 1 }}
{{ $lores := .Resize "800x webp Lanczos q60" }}
{{ $hires := .Resize "2500x webp Lanczos q75" }}
{{ $Page.Scratch.Add "img" (dict
"index" (int $index)
"loUrl" (string $lores.RelPermalink)
"loImgH" (int $lores.Height)
"loImgW" (int $lores.Width)
"hiUrl" (string $hires.RelPermalink)
"hiImgH" (int $hires.Height)
"hiImgW" (int $hires.Width)
)
}}
{{- end -}}
<script id="imagesSource" type="application/json">{{ $Page.Scratch.Get "img" | jsonify | safeJS }}</script>
{{- end -}}