| layouts/shortcodes/picture.html | ●●●●● patch | view | raw | blame | history |
layouts/shortcodes/picture.html
New file @@ -0,0 +1,9 @@ {{- $normal := .Get 0 }} {{- $dark := .Get 1 }} {{- $alt := .Get 2 }} {{- $normalPath := absURL (printf "images/%s" $normal) }} {{- $darkPath := absURL (printf "images/%s" $dark) }} <picture class = 'nav_logo'> <source srcset = '{{ $darkPath }}' media="(prefers-color-scheme: dark)"> <img srcset = '{{ $normalPath }}' alt = '{{ $alt }}'> </picture>