{{ $linkTitle := i18n "commons.lightbox.link.title" }} {{ $options := (dict ) }} {{ with .description }} {{ $options = merge $options (dict "description" ( . | plainify )) }} {{ $options = merge $options (dict "descriptionhtml" (partial "PrepareHTML" . )) }} {{ $linkTitle = (printf "%s %s" $linkTitle . ) }} {{ end }} {{ with .credit }} {{ $options = merge $options (dict "credit" (. | plainify)) }} {{ $options = merge $options (dict "credithtml" (partial "PrepareHTML" . )) }} {{ end }} {{ $index := partial "PrepareHTML" .index }} {{ $total := partial "PrepareHTML" .total }} {{ if and $index $total }} {{ $options = merge $options (dict "gallery_values" (dict "index" $index "total" $total)) }} {{ end }} {{ $linkTitle | plainify }} {{ partial "commons/image.html" (dict "image" .image "alt" .alt "sizes" .sizes "lazy" .lazy ) }}