1
0
Fork 0
faulty.equipment/themes/fesite/layouts/_default/_markup/render-image.html

50 lines
1.8 KiB
HTML
Raw Permalink Normal View History

2023-09-11 15:02:41 +00:00
<figure width="100%">
<a href="#{{ .Destination | md5 }}-lightbox"
2023-09-15 21:46:50 +00:00
><picture>
{{ $avifPath:= replace .Destination (path.Ext .Destination) ".avif" }} {{
$avifPathStatic:= printf "static/%s" $avifPath }} {{ if (fileExists
$avifPathStatic) -}}
<source srcset="{{ $avifPath | safeURL }}" type="image/avif" />
2023-10-06 11:29:25 +00:00
{{- end }} {{ if eq (path.Ext .Destination) ".jpg" }}
2023-09-15 21:46:50 +00:00
<source type="image/jpeg" srcset="{{ .Destination | safeURL }}" />
{{ end }} {{ if eq (path.Ext .Destination) ".jpeg" }}
<source type="image/jpeg" srcset="{{ .Destination | safeURL }}" />
{{ end }} {{ if eq (path.Ext .Destination) ".png" }}
<source
type="image/png"
srcset="{{
.Destination | safeURL }}"
/>
{{ end }}
<img src="{{ .Destination | safeURL }}" alt="{{ .PlainText }}" />
</picture>
</a>
2023-09-11 15:02:41 +00:00
<figcaption>
{{ if .Title }}
<p>{{ .Title | markdownify }}</p>
{{ else if .Text }}
2023-09-13 19:59:07 +00:00
<p>{{ .Text | htmlUnescape }}</p>
2023-09-11 15:02:41 +00:00
{{ end }}
</figcaption>
</figure>
<a href="#_" class="lightbox" id="{{ .Destination | md5 }}-lightbox">
2023-09-15 21:46:50 +00:00
<picture>
{{ $avifPath:= replace .Destination (path.Ext .Destination) ".avif" }} {{
$avifPathStatic:= printf "static/%s" $avifPath }} {{ if (fileExists
$avifPathStatic) -}}
<source srcset="{{ $avifPath | safeURL }}" type="image/avif" />
2023-10-06 11:29:25 +00:00
{{- end }} {{ if eq (path.Ext .Destination) ".jpg" }}
2023-09-15 21:46:50 +00:00
<source type="image/jpeg" srcset="{{ .Destination | safeURL }}" />
{{ end }} {{ if eq (path.Ext .Destination) ".jpeg" }}
<source type="image/jpeg" srcset="{{ .Destination | safeURL }}" />
{{ end }} {{ if eq (path.Ext .Destination) ".png" }}
<source
type="image/png"
srcset="{{
.Destination | safeURL }}"
/>
{{ end }}
<img src="{{ .Destination | safeURL }}" alt="{{ .PlainText }}" />
</picture>
2023-09-11 15:02:41 +00:00
</a>