2021-02-02 06:24:40 +00:00
|
|
|
{{ $light_svg := resources.GetMatch (printf "/p/%s.svg" (.Get "name")) -}}
|
2021-01-28 21:08:21 +00:00
|
|
|
{{ $light_png := resources.GetMatch (printf "/p/%s.png" (.Get "name")) -}}
|
|
|
|
{{ $light_webp := resources.GetMatch (printf "/p/%s.webp" (.Get "name")) -}}
|
|
|
|
{{ $light_avif := resources.GetMatch (printf "/p/%s.avif" (.Get "name")) -}}
|
2021-06-28 02:25:58 +00:00
|
|
|
{{ $light_jxl := resources.GetMatch (printf "/p/%s.jxl" (.Get "name")) -}}
|
2021-02-02 06:24:40 +00:00
|
|
|
{{ $dark_svg := resources.GetMatch (printf "/p/%s_dark.svg" (.Get "name")) -}}
|
2021-01-28 21:08:21 +00:00
|
|
|
{{ $dark_png := resources.GetMatch (printf "/p/%s_dark.png" (.Get "name")) -}}
|
|
|
|
{{ $dark_webp := resources.GetMatch (printf "/p/%s_dark.webp" (.Get "name")) -}}
|
|
|
|
{{ $dark_avif := resources.GetMatch (printf "/p/%s_dark.avif" (.Get "name")) -}}
|
2021-06-28 02:25:58 +00:00
|
|
|
{{ $dark_jxl := resources.GetMatch (printf "/p/%s_dark.jxl" (.Get "name")) -}}
|
2021-01-27 21:47:46 +00:00
|
|
|
<picture>
|
2021-02-02 06:24:40 +00:00
|
|
|
{{ with $dark_svg -}}
|
|
|
|
{{ $dark_svg_src := . | resources.Fingerprint "md5" -}}
|
|
|
|
<source
|
|
|
|
srcset="{{ $dark_svg_src.RelPermalink }}"
|
|
|
|
type="image/svg+xml"
|
|
|
|
media="(prefers-color-scheme: dark)">
|
|
|
|
{{ end -}}
|
2021-06-28 02:25:58 +00:00
|
|
|
{{ with $dark_jxl -}}
|
|
|
|
{{ $dark_jxl_src := . | resources.Fingerprint "md5" -}}
|
|
|
|
<source
|
|
|
|
srcset="{{ $dark_jxl_src.RelPermalink }}"
|
|
|
|
type="image/jxl"
|
|
|
|
media="(prefers-color-scheme: dark)">
|
|
|
|
{{ end -}}
|
2021-01-27 21:47:46 +00:00
|
|
|
{{ with $dark_avif -}}
|
2021-01-28 21:08:21 +00:00
|
|
|
{{ $dark_avif_src := . | resources.Fingerprint "md5" -}}
|
2021-01-27 21:47:46 +00:00
|
|
|
<source
|
2021-01-28 21:08:21 +00:00
|
|
|
srcset="{{ $dark_avif_src.RelPermalink }}"
|
2021-01-27 21:47:46 +00:00
|
|
|
type="image/avif"
|
|
|
|
media="(prefers-color-scheme: dark)">
|
|
|
|
{{ end -}}
|
|
|
|
{{ with $dark_webp -}}
|
2021-01-28 21:08:21 +00:00
|
|
|
{{ $dark_webp_src := . | resources.Fingerprint "md5" -}}
|
2021-01-27 21:47:46 +00:00
|
|
|
<source
|
2021-01-28 21:08:21 +00:00
|
|
|
srcset="{{ $dark_webp_src.RelPermalink }}"
|
2021-01-27 21:47:46 +00:00
|
|
|
type="image/webp"
|
|
|
|
media="(prefers-color-scheme: dark)">
|
|
|
|
{{ end -}}
|
|
|
|
{{ with $dark_png -}}
|
2021-01-28 21:08:21 +00:00
|
|
|
{{ $dark_png_src := . | resources.Fingerprint "md5" -}}
|
2021-01-27 21:47:46 +00:00
|
|
|
<source
|
2021-01-28 21:08:21 +00:00
|
|
|
srcset="{{ $dark_png_src.RelPermalink }}"
|
2021-01-27 21:47:46 +00:00
|
|
|
type="image/png"
|
|
|
|
media="(prefers-color-scheme: dark)">
|
|
|
|
{{ end -}}
|
2021-02-02 06:24:40 +00:00
|
|
|
{{ with $light_svg -}}
|
|
|
|
{{ $light_svg_src := . | resources.Fingerprint "md5" -}}
|
|
|
|
<source
|
|
|
|
srcset="{{ $light_svg_src.RelPermalink }}"
|
|
|
|
type="image/svg+xml">
|
|
|
|
{{ end -}}
|
2021-06-28 02:25:58 +00:00
|
|
|
{{ with $light_jxl -}}
|
|
|
|
{{ $light_jxl_src := . | resources.Fingerprint "md5" -}}
|
|
|
|
<source
|
|
|
|
srcset="{{ $light_jxl_src.RelPermalink }}"
|
|
|
|
type="image/jxl">
|
|
|
|
{{ end -}}
|
2021-01-27 21:47:46 +00:00
|
|
|
{{ with $light_avif -}}
|
2021-01-28 21:08:21 +00:00
|
|
|
{{ $light_avif_src := . | resources.Fingerprint "md5" -}}
|
2021-01-27 21:47:46 +00:00
|
|
|
<source
|
2021-01-28 21:08:21 +00:00
|
|
|
srcset="{{ $light_avif_src.RelPermalink }}"
|
|
|
|
type="image/avif">
|
2021-01-27 21:47:46 +00:00
|
|
|
{{ end -}}
|
|
|
|
{{ with $light_webp -}}
|
2021-01-28 21:08:21 +00:00
|
|
|
{{ $light_webp_src := . | resources.Fingerprint "md5" -}}
|
2021-01-27 21:47:46 +00:00
|
|
|
<source
|
2021-01-28 21:08:21 +00:00
|
|
|
srcset="{{ $light_webp_src.RelPermalink }}"
|
|
|
|
type="image/webp">
|
2021-01-27 21:47:46 +00:00
|
|
|
{{ end -}}
|
2021-01-28 21:08:21 +00:00
|
|
|
{{ $light_png_src := $light_png | resources.Fingerprint "md5" -}}
|
2021-01-27 21:47:46 +00:00
|
|
|
<source
|
2021-01-28 21:08:21 +00:00
|
|
|
srcset="{{ $light_png_src.RelPermalink }}"
|
|
|
|
type="image/png">
|
2021-01-27 21:47:46 +00:00
|
|
|
<img
|
2021-03-02 05:26:57 +00:00
|
|
|
width="{{ $light_png.Width }}" height="{{ $light_png.Height }}"
|
2021-06-28 02:25:58 +00:00
|
|
|
src="{{ $light_png.RelPermalink }}" alt='{{ .Get "alt" }}'
|
|
|
|
decoding="async">
|
2022-02-19 20:47:07 +00:00
|
|
|
</picture>{{- /* Strip trailing newline: https://github.com/gohugoio/hugo/issues/1753 */ -}}
|