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

55 lines
1.5 KiB
HTML

{{- $search := "**.jpg" -}}
{{- $keep := false -}}
{{- $title := true -}}
{{- $description := true -}}
{{- $lightbox := true -}}
{{- if .IsNamedParams -}}
{{- with .Get "search" -}}
{{ $search = . }}
{{- end -}}
{{- with .Get "original" -}}
{{- $keep = true }}
{{- end -}}
{{- with .Get "title" -}}
{{ $title = . }}
{{- end -}}
{{- $description := true -}}
{{ with .Get "description" -}}
{{- end -}}
{{- with .Get "lightbox" -}}
{{ $lightbox = true }}
{{- end -}}
{{- else -}}
{{- with .Get 0 -}}
{{ $search = . }}
{{- end -}}
{{- with .Get 1 -}}
{{ $title = . }}
{{- end -}}
{{- with .Get 2 -}}
{{ $description = . }}
{{- end -}}
{{- with .Get 3 -}}
{{ $keep = true }}
{{- end -}}
{{- with .Get 4 -}}
{{ $lightbox = true }}
{{- end -}}
{{- end -}}
<div class="clearfix"></div>
{{ with .Inner }}
<ul class="list-unstyled flex row gallery neg-margin">
{{ . }}
</ul>
{{ else }}
<ul class="list-unstyled flex row gallery neg-margin">
{{ 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>
{{- end -}}