{{ $image := .image }} {{ $caption := .caption }} {{ $method := .method }} {{ $options := .options }} {{ $thumbnail := $image }} {{ with $image }} {{ if eq $method "crop" }} {{ $thumbnail = .Crop $options }} {{ else if eq $method "fill" }} {{ $thumbnail = .Fill $options }} {{ else if eq $method "fit" }} {{ $thumbnail = .Fit $options }} {{ else if eq $method "resize" }} {{ $thumbnail = .Resize $options }} {{ end }} {{ end }}
{{ with $caption }}
{{ . }}
{{ end }}