2022-08-18 03:08:50 +00:00
|
|
|
{{ $img := resources.Get (.Get "src") }}
|
2022-06-07 13:54:07 +00:00
|
|
|
<figure {{ with .Get "class" }}class='{{.}}'{{ end }}>
|
2022-08-18 03:08:50 +00:00
|
|
|
{{ with $img.Resize (printf "%dx webp q69" $img.Width) | fingerprint }}
|
2022-06-07 13:54:07 +00:00
|
|
|
<a href='{{ with $.Get "link" }}{{ . }}{{ else }}{{ .RelPermalink }}{{ end }}' target='_blank'>
|
|
|
|
<img src='{{ .RelPermalink }}' integrity='{{ .Data.Integrity }}'
|
|
|
|
{{ if or ($.Get "alt") ($.Get "caption") }}alt='{{ with $.Get "alt" }}{{ . }}
|
|
|
|
{{ else }}{{ $.Get "caption" }}{{ end }}'{{ end }} />
|
|
|
|
</a>
|
|
|
|
{{ end }}
|
|
|
|
{{ if or (or (.Get "title") (.Get "caption")) (.Get "attr") }}
|
|
|
|
<figcaption>{{ if isset .Params "title" }}
|
|
|
|
<h4>{{ .Get "title" }}</h4>{{ end }}
|
|
|
|
{{ if or (.Get "caption") (.Get "attr") }}<p>
|
|
|
|
{{ .Get "caption" }}
|
|
|
|
{{ with .Get "attrlink" }}<a href="{{ . }}"> {{ end }}
|
|
|
|
{{ .Get "attr" }}
|
|
|
|
{{ if .Get "attrlink" }}</a> {{ end }}
|
|
|
|
</p> {{ end }}
|
|
|
|
</figcaption>
|
|
|
|
{{ end }}
|
|
|
|
</figure>
|