{{- $source := ($.Page.Resources.ByType "image").GetMatch (printf "%s" (.Get "name")) }} {{- $customAlt := .Get "alt" }} {{- $customSize := .Get "size" | lower }} {{- $lazyLoad := default (default true $.Site.Params.GeekblogImageLazyLoading) (.Get "lazy") }} {{- $data := newScratch }} {{- with $source }} {{- $caption := default .Title $customAlt }} {{- $isSVG := (eq .MediaType.SubType "svg") }} {{- $origin := .Permalink }} {{- if $isSVG }} {{- $data.SetInMap "size" "profile" "180" }} {{- $data.SetInMap "size" "tiny" "320" }} {{- $data.SetInMap "size" "small" "600" }} {{- $data.SetInMap "size" "medium" "1200" }} {{- $data.SetInMap "size" "large" "1800" }} {{- else }} {{- $data.SetInMap "size" "profile" (.Fill "180x180 Center").Permalink }} {{- $data.SetInMap "size" "tiny" (.Resize "320x").Permalink }} {{- $data.SetInMap "size" "small" (.Resize "600x").Permalink }} {{- $data.SetInMap "size" "medium" (.Resize "1200x").Permalink }} {{- $data.SetInMap "size" "large" (.Resize "1800x").Permalink }} {{- end }}
{{- $size := $data.Get "size" }} {{- if not $isSVG }} {{- end }} {{ $caption }} {{- if not (eq $customSize "profile") }} {{- with $caption }}
{{ . }} {{- with $source.Params.credits }} {{ printf " (%s)" . | $.Page.RenderString }} {{- end }}
{{- end }} {{- end }}
{{- end }}