{{- /* See https://github.com/gohugoio/hugo/blob/master/tpl/tplimpl/embedded/templates/shortcodes/figure.html */ -}} {{- $srcset := slice -}} {{- /* Matching uses relative paths so strip a leading / character if present. */ -}} {{- $image := partial "func/GetImageResource" (dict "src" (.Get "src") "pageResources" .Page.Resources) -}} {{- with $image -}} {{- /* Standard width of main is 70% (w-70-ns) */ -}} {{- $target_width := 0.70 -}} {{- $srcset = partial "func/GetImageSrcset" (dict "original" . "target_width" $target_width) -}} {{- end -}} {{- if .Get "link" -}} {{- end -}} {{ with .Get {{- if .Get "link" }}{{ end -}} {{- if or (or (.Get "title") (.Get "caption")) (.Get "attr") -}}
{{ with (.Get "title") -}}

{{ . }}

{{- end -}} {{- if or (.Get "caption") (.Get "attr") -}}

{{- .Get "caption" | markdownify -}} {{- with .Get "attrlink" }} {{- end -}} {{- .Get "attr" | markdownify -}} {{- if .Get "attrlink" }}{{ end }}

{{- end }}
{{- end }}