2023-10-11 21:55:42 +02:00
|
|
|
{{- $imagename := (.Get 0) }}
|
|
|
|
{{- $options := .Get 1 }}
|
|
|
|
{{- $classes := .Get 2 | default "" }}
|
|
|
|
{{- $link := .Get 3 | default "" }}
|
|
|
|
{{- $isBundle := ne .Page.BundleType "" }}
|
|
|
|
|
|
|
|
{{- $page := .Page }}
|
|
|
|
{{- if not $isBundle }}
|
2023-10-17 22:52:36 +02:00
|
|
|
{{ $page_dir := path.Dir .Page.File }}
|
|
|
|
{{ $pagebundle_path := path.Join "/" $page_dir }}
|
|
|
|
{{ $page = .Site.GetPage $pagebundle_path }}
|
|
|
|
{{- if not $page.IsPage }}
|
|
|
|
{{ $pagebundle_path := path.Join "/" .Page.Section }}
|
2023-10-11 21:55:42 +02:00
|
|
|
{{ $page = .Site.GetPage $pagebundle_path }}
|
2023-10-17 22:52:36 +02:00
|
|
|
{{- end -}}
|
2023-10-11 21:55:42 +02:00
|
|
|
{{- end -}}
|
|
|
|
|
|
|
|
{{- with $page.Resources.Get $imagename }}
|
|
|
|
{{- with .Resize $options -}}
|
|
|
|
{{ if $link }}<a href="{{ $link }}">{{ end }}
|
|
|
|
<img src="{{ .RelPermalink }}" class="md-img {{ $classes }}" width="{{ .Width }}" height="{{ .Height }}">
|
|
|
|
{{ if $link }}</a>{{ end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|