1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-23 21:02: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 <source
srcset="{{ $dark_svg_src.RelPermalink }}" srcset="{{ $dark_svg_src.RelPermalink }}"
type="image/svg+xml" type="image/svg+xml"
media="(prefers-color-scheme: dark)"> media="screen and (prefers-color-scheme: dark)">
{{ end -}} {{ end -}}
{{ with $dark_jxl -}} {{ with $dark_jxl -}}
{{ $dark_jxl_src := . | resources.Fingerprint "md5" -}} {{ $dark_jxl_src := . | resources.Fingerprint "md5" -}}
<source <source
srcset="{{ $dark_jxl_src.RelPermalink }}" srcset="{{ $dark_jxl_src.RelPermalink }}"
type="image/jxl" type="image/jxl"
media="(prefers-color-scheme: dark)"> media="screen and (prefers-color-scheme: dark)">
{{ end -}} {{ end -}}
{{ with $dark_avif -}} {{ with $dark_avif -}}
{{ $dark_avif_src := . | resources.Fingerprint "md5" -}} {{ $dark_avif_src := . | resources.Fingerprint "md5" -}}
<source <source
srcset="{{ $dark_avif_src.RelPermalink }}" srcset="{{ $dark_avif_src.RelPermalink }}"
type="image/avif" type="image/avif"
media="(prefers-color-scheme: dark)"> media="screen and (prefers-color-scheme: dark)">
{{ end -}} {{ end -}}
{{ with $dark_webp -}} {{ with $dark_webp -}}
{{ $dark_webp_src := . | resources.Fingerprint "md5" -}} {{ $dark_webp_src := . | resources.Fingerprint "md5" -}}
<source <source
srcset="{{ $dark_webp_src.RelPermalink }}" srcset="{{ $dark_webp_src.RelPermalink }}"
type="image/webp" type="image/webp"
media="(prefers-color-scheme: dark)"> media="screen and (prefers-color-scheme: dark)">
{{ end -}} {{ end -}}
{{ with $dark_png -}} {{ with $dark_png -}}
{{ $dark_png_src := . | resources.Fingerprint "md5" -}} {{ $dark_png_src := . | resources.Fingerprint "md5" -}}
<source <source
srcset="{{ $dark_png_src.RelPermalink }}" srcset="{{ $dark_png_src.RelPermalink }}"
type="image/png" type="image/png"
media="(prefers-color-scheme: dark)"> media="screen and (prefers-color-scheme: dark)">
{{ end -}} {{ end -}}
{{ with $light_svg -}} {{ with $light_svg -}}
{{ $light_svg_src := . | resources.Fingerprint "md5" -}} {{ $light_svg_src := . | resources.Fingerprint "md5" -}}