blob: ff262c73ff9b9c2c573c44f93636ffb7abc3f66d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
{{- $file := .Get 0 }}
{{- $path := printf "content_images/%s" $file}}
{{- $img := resources.Get $path }}
{{- $caption := .Inner }}
{{- $source := .Get 1 }}
{{- $imgclass := .Get 2 }}
{{- $img1x := $img.Resize "800x webp q90"}}
{{- $img2x := $img.Resize "1600x webp q90"}}
<figure>
<a href="{{ $img.Permalink }}">
<img
class="center {{ $imgclass }}"
alt="{{ $caption }}"
src="{{ $img1x.Permalink }}"
srcset="
{{ $img1x.Permalink }} 1x,
{{ $img2x.Permalink }} 2x
"
width="{{ $img1x.Width }}"
height="{{ $img1x.Height }}"
>
</a>
<figcaption>
{{ $caption }}
{{- if $source }}
<a href="{{ $source }}" target="_blank" title="source">[source]</a>
{{ end }}
</figcaption>
</figure>
|