1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-10 00:12:09 +00:00

Exclude dark image variants from print media

Save some ink, yo
This commit is contained in:
Rohan Kumar 2022-03-17 23:30:46 -07:00
parent 208b0fe43e
commit 35b6c2eeae
No known key found for this signature in database
GPG key ID: 1E892DB2A5F84479

View file

@ -14,35 +14,35 @@
<source
srcset="{{ $dark_svg_src.RelPermalink }}"
type="image/svg+xml"
media="(prefers-color-scheme: dark)">
media="screen and (prefers-color-scheme: dark)">
{{ end -}}
{{ with $dark_jxl -}}
{{ $dark_jxl_src := . | resources.Fingerprint "md5" -}}
<source
srcset="{{ $dark_jxl_src.RelPermalink }}"
type="image/jxl"
media="(prefers-color-scheme: dark)">
media="screen and (prefers-color-scheme: dark)">
{{ end -}}
{{ with $dark_avif -}}
{{ $dark_avif_src := . | resources.Fingerprint "md5" -}}
<source
srcset="{{ $dark_avif_src.RelPermalink }}"
type="image/avif"
media="(prefers-color-scheme: dark)">
media="screen and (prefers-color-scheme: dark)">
{{ end -}}
{{ with $dark_webp -}}
{{ $dark_webp_src := . | resources.Fingerprint "md5" -}}
<source
srcset="{{ $dark_webp_src.RelPermalink }}"
type="image/webp"
media="(prefers-color-scheme: dark)">
media="screen and (prefers-color-scheme: dark)">
{{ end -}}
{{ with $dark_png -}}
{{ $dark_png_src := . | resources.Fingerprint "md5" -}}
<source
srcset="{{ $dark_png_src.RelPermalink }}"
type="image/png"
media="(prefers-color-scheme: dark)">
media="screen and (prefers-color-scheme: dark)">
{{ end -}}
{{ with $light_svg -}}
{{ $light_svg_src := . | resources.Fingerprint "md5" -}}