2022-09-26 11:06:31 -04:00
|
|
|
{{- $url := .Destination | safeURL -}}
|
|
|
|
{{- $img := .Page.Resources.GetMatch .Destination -}}
|
|
|
|
|
|
|
|
{{- if and (not $img) .Page.File -}}
|
2022-12-20 14:16:26 -05:00
|
|
|
{{ with .Page.File }}
|
2022-12-20 18:02:29 -05:00
|
|
|
{{ $path := path.Join .Dir $url }}
|
2022-12-20 14:16:26 -05:00
|
|
|
{{- $img = resources.Get $path -}}
|
|
|
|
{{ end }}
|
2022-09-26 11:06:31 -04:00
|
|
|
{{- end -}}
|
2022-12-04 07:33:52 -05:00
|
|
|
|
|
|
|
{{- if and (not $img) .Page.File -}}
|
|
|
|
{{- $img = resources.Get .Destination -}}
|
|
|
|
{{- end -}}
|
|
|
|
|
2022-09-26 11:06:31 -04:00
|
|
|
{{- with $img -}}
|
2022-12-27 22:34:31 -05:00
|
|
|
<figure>
|
|
|
|
<a href="{{ $img.RelPermalink }}" data-download="true">
|
|
|
|
{{ if eq .MediaType.SubType "svg" }}
|
|
|
|
<img class="article-img" src="{{ $img.RelPermalink }}" alt="{{ $.Text }}" />
|
|
|
|
{{ else }}
|
|
|
|
<img class="article-img" width="{{ $img.Width }}" height="{{ $img.Height }}" src="{{ $img.RelPermalink }}" alt="{{ $.Text }}" />
|
|
|
|
{{ end }}
|
|
|
|
</a>
|
2022-09-26 11:06:31 -04:00
|
|
|
|
2022-12-27 22:34:31 -05:00
|
|
|
<figcaption>{{ $.Text | safeHTML }}</figcaption>
|
|
|
|
</figure>
|
2022-10-27 09:55:48 -04:00
|
|
|
{{- else -}}
|
2022-12-27 22:34:31 -05:00
|
|
|
<em>Unable to find image {{ $url }}!</em>
|
2022-09-26 11:06:31 -04:00
|
|
|
{{- end -}}
|