Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
18 lines (18 sloc) 735 Bytes
{{- $img := .Page.Resources.GetMatch .Destination -}}
{{- if and (not $img) .Page.File -}}
{{ $path := path.Join .Page.File.Dir .Destination }}
{{- $img = resources.Get $path -}}
{{- end -}}
{{- with $img -}}
{{- $large := $img.Resize "1200x" -}}
{{ $medium := $large.Fill "726x402" -}}
{{ $small := $medium.Fill "458x254" -}}
<figure class="image-caption">
<img alt="{{ $.Text }}" srcset="
{{ $small.RelPermalink }} 458w,
{{ $medium.RelPermalink }} 726w,
{{ $large.RelPermalink }} 1200w" sizes="50vw" src="{{ $small.RelPermalink }}" />
<figcaption>{{ with $.Title | safeHTML }}{{ . }}{{ end }}</figcaption>
</figure>
{{- else -}}
<img src="{{ .Destination | safeURL }}" alt="{{ $.Text }}" />{{- end -}}
You can’t perform that action at this time.