2023-12-23 23:01:53 +00:00
|
|
|
<!--
|
|
|
|
type: string - default
|
|
|
|
url: string
|
|
|
|
alt: string
|
|
|
|
-->
|
|
|
|
{{ $avatar := "avatar"}}
|
2024-01-08 09:23:35 +00:00
|
|
|
|
|
|
|
<picture>
|
|
|
|
<source
|
|
|
|
type="image/avif"
|
|
|
|
src="{{ .url }}.avif"
|
|
|
|
/>
|
|
|
|
<source
|
|
|
|
type="image/webp"
|
|
|
|
src="{{ .url }}.webp"
|
|
|
|
/>
|
|
|
|
<img
|
|
|
|
class="{{if eq .type $avatar}} avatar {{end}}"
|
|
|
|
alt="{{ .alt }}"
|
|
|
|
src="{{ .url }}"
|
|
|
|
loading="lazy"
|
|
|
|
decoding="async"
|
|
|
|
>
|
|
|
|
</picture>
|
|
|
|
|
2024-01-06 19:44:35 +00:00
|
|
|
|
|
|
|
{{/* https://www.brycewray.com/posts/2023/05/better-code-image-processing-hugo-render-hook-edition/ */}}
|