{{- $imagename := (.Get 0) }} {{- $options := .Get 1 }} {{- $classes := .Get 2 | default "" }} {{- $link := .Get 3 | default "" }} {{- $isBundle := ne .Page.BundleType "" }} {{- $page := .Page }} {{- if not $isBundle }} {{ $page_dir := path.Dir .Page.File }} {{ $pagebundle_path := path.Join "/" $page_dir }} {{ $page = .Site.GetPage $pagebundle_path }} {{- end -}} {{- with $page.Resources.Get $imagename }} {{- with .Resize $options -}} {{ if $link }}{{ end }} {{ if $link }}{{ end }} {{- end }} {{- end }}