gallery/layouts/partials/albums/images.json

25 lines
744 B
JSON

{{- $first := true -}}
{{- $filter := images.AutoOrient -}}
{{- $teaser := "" -}}
{{- with .Params.teaserImage -}}
{{- $teaser = $.Resources.GetMatch . -}}
{{- end -}}
{{- range .Resources.ByType "image" -}}
{{- if not (eq $teaser .) -}}
{{- if not $first }}, {{ end }}
{{ $first = false -}}
{{- with . | images.Filter $filter -}}
{
"title": "{{ .Title }}",
"url": "{{ .RelPermalink }}",
"width": "{{ .Width }}",
"height": "{{ .Height }}",
"thumbnail": "{{ (.Fit "300x200").RelPermalink }}"
}
{{- end -}}
{{- else -}}
{{ warnf "Skipping teaser image" }}
{{- end -}}
{{ end -}}