neff-steindesign.de/themes/neff/layouts/shortcodes/gallery.html

68 lines
1.4 KiB
HTML

{{- $search := "**.jpg" -}}
{{ with .Get "search" -}}
{{- $search = . }}
{{- else -}}
{{- $search = .Get 0 -}}
{{- end -}}
{{- $keep := false -}}
{{- with .Get "original" -}}
{{- $keep = . }}
{{- else -}}
{{- $keep = .Get 3 -}}
{{- end -}}
{{- if eq $keep "true" -}}
{{- $keep = true -}}
{{- else -}}
{{- $keep = false -}}
{{- end -}}
{{- $title := true -}}
{{- with .Get "title" -}}
{{- $title = . }}
{{- else -}}
{{- $title = .Get 1 -}}
{{- end -}}
{{- if eq $title "false" -}}
{{- $title = false -}}
{{- else -}}
{{- $title = true -}}
{{- end -}}
{{- $description := true -}}
{{- with .Get "description" -}}
{{- $description = . }}
{{- else -}}
{{- $description = .Get 2 -}}
{{- end -}}
{{- if eq $description "false" -}}
{{- $description = false -}}
{{- else -}}
{{- $description = true -}}
{{- end -}}
{{- $lightbox := true -}}
{{- with .Get "lightbox" -}}
{{- $lightbox = . }}
{{- else -}}
{{- $lightbox = .Get 2 -}}
{{- end -}}
{{- if eq $lightbox "false" -}}
{{- $lightbox = false -}}
{{- else -}}
{{- $lightbox = true -}}
{{- end -}}
<ul class="clearfix list-unstyled flex row gallery">
{{ range $.Page.Resources.Match $search }}
{{- if (ne .Params.featured true) -}}
<li class="padding">
{{- partial "figure.html" (dict "image" . "ctx" . "lightbox" $lightbox "class" "gallery" "showTitle" $title "showDescription" $description "keepOriginal" $keep) -}}
</li>
{{- end -}}
{{- end -}}
</ul>