forked from laurens/fediversity_website
Gehele figure-tag linken ipv alleen img, anders worden alsnog jpg/png geladen ipv webp
This commit is contained in:
parent
5172b4f62f
commit
a7092d3990
|
@ -1,5 +1,6 @@
|
||||||
|
{{ if .link }}<a href="{{ .link }}">{{ end }}
|
||||||
<figure>
|
<figure>
|
||||||
<picture>
|
<picture>
|
||||||
{{ $isJPG := eq (path.Ext .image) ".jpg" }}
|
{{ $isJPG := eq (path.Ext .image) ".jpg" }}
|
||||||
{{ $isPNG := eq (path.Ext .image) ".png" }}
|
{{ $isPNG := eq (path.Ext .image) ".png" }}
|
||||||
|
|
||||||
|
@ -21,13 +22,13 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{ $img := imageConfig (add "/static" (.image | safeURL)) }}
|
{{ $img := imageConfig (add "/static" (.image | safeURL)) }}
|
||||||
{{ if .link }}<a href="{{ .link }}">{{ end }}
|
|
||||||
<img src="{{ .image | safeURL }}" alt="{{ .alt }}" loading="lazy" decoding="async" width="{{ $img.Width }}" height="{{ $img.Height }}">
|
<img src="{{ .image | safeURL }}" alt="{{ .alt }}" loading="lazy" decoding="async" width="{{ $img.Width }}" height="{{ $img.Height }}">
|
||||||
{{ if .link }}</a>{{ end }}
|
</picture>
|
||||||
</picture>
|
{{ if .figcaption }}
|
||||||
{{ if .figcaption }}
|
<figcaption>
|
||||||
<figcaption>
|
<small><strong>{{ .figcaption }}</strong></small>
|
||||||
<small><strong>{{ .figcaption }}</strong></small>
|
</figcaption>
|
||||||
</figcaption>
|
{{ end }}
|
||||||
</figure>
|
</figure>
|
||||||
{{ end }}
|
{{ if .link }}</a>{{ end }}
|
||||||
|
|
Reference in a new issue