1
0
Fork 0
mirror of https://git.sr.ht/~seirdy/seirdy.one synced 2024-11-14 17:42:09 +00:00
seirdy.one/layouts/shortcodes/indieweb-icon.html
Rohan Kumar ca07453315
Don't include an unused png fallback for an SVG
No browser I know of falls back to a PNG when given an SVG with a PNG
fallback. The Tor version of my site uses no SVGs.

Exclude the SVG favicon in the Tor version of the site, since the Tor
Browser disables SVG on the safest setting.
2022-03-10 21:33:51 -08:00

11 lines
625 B
HTML

{{ $favicon := resources.Get "/favicon.png" -}}
{{- $favicon_base64 := $favicon.Content | base64Encode -}}
{{- $favicon_svg := resources.Get "/favicon.svg" | resources.Fingerprint "md5" -}}
{{- $favicon_bigpng := resources.Get "/apple-touch-icon.png" | resources.Fingerprint "md5" -}}
<img itemprop="image" class="u-photo photo" width="16" height="16" alt=""
{{ if (eq .Site.BaseURL "http://wgq3bd2kqoybhstp77i3wrzbfnsyd27wt34psaja4grqiezqircorkyd.onion/") -}}
src="data:image/png;base64,{{ $favicon_base64 }}" srcset="{{ $favicon_bigpng.RelPermalink }} 2x"
{{- else -}}
src="{{ $favicon_svg.RelPermalink }}"
{{- end -}}
>