mirror of
https://git.sr.ht/~ashkeel/strimertul-website
synced 2024-12-21 23:12:19 +00:00
49 lines
1.9 KiB
HTML
49 lines
1.9 KiB
HTML
|
<figure width="100%">
|
||
|
<a href="#{{ .Destination | md5 }}-lightbox"
|
||
|
><picture>
|
||
|
{{ if not (hasPrefix .Destination "http" ) }}
|
||
|
{{ $avifPath:= replace .Destination (path.Ext .Destination) ".avif" }}
|
||
|
{{ $avifPathStatic := printf "%s/static/%s" .Page.File.Dir $avifPath }}
|
||
|
{{ if (fileExists
|
||
|
$avifPathStatic)
|
||
|
-}}
|
||
|
<source srcset="{{ $avifPath | safeURL }}" type="image/avif" />
|
||
|
{{- end }}
|
||
|
{{ if eq (path.Ext .Destination) ".jpg" }}
|
||
|
<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 }}
|
||
|
{{ end }}
|
||
|
<img src="{{ .Destination | safeURL }}" alt="{{ .PlainText }}" />
|
||
|
</picture>
|
||
|
</a>
|
||
|
</figure>
|
||
|
<a href="#_" class="lightbox" id="{{ .Destination | md5 }}-lightbox">
|
||
|
<picture>
|
||
|
{{ if not (hasPrefix .Destination "http") }}
|
||
|
{{ $avifPath:= replace .Destination (path.Ext .Destination) ".avif" }}
|
||
|
{{ $avifPathStatic := printf "%s/static/%s" .Page.File.Dir $avifPath }}
|
||
|
{{ if (fileExists
|
||
|
$avifPathStatic)
|
||
|
-}}
|
||
|
<source srcset="{{ $avifPath | safeURL }}" type="image/avif" />
|
||
|
{{- end }}
|
||
|
{{ if eq (path.Ext .Destination) ".jpg" }}
|
||
|
<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 }}
|
||
|
{{ end }}
|
||
|
<img src="{{ .Destination | safeURL }}" alt="{{ .PlainText }}" />
|
||
|
</picture>
|
||
|
</a>
|