Make banners pixelated, fix rendering issues on safari

This commit is contained in:
Joshua Goins 2023-03-06 21:41:08 -05:00
parent ee0c2d2356
commit 2e0a27c0a8
2 changed files with 3 additions and 2 deletions

View file

@ -2,7 +2,7 @@
{{ range $.Site.Menus.badges }} {{ range $.Site.Menus.badges }}
{{ $badgeScope := . }} {{ $badgeScope := . }}
{{ with resources.Get .URL }} {{ with resources.Get .URL }}
<img width="{{ .Width }}" height="{{ .Height }}" src="{{ .Permalink }}" alt="{{ $badgeScope.Name }}"> <img style="image-rendering: pixelated;" width="{{ .Width }}" height="{{ .Height }}" src="{{ .Permalink }}" alt="{{ $badgeScope.Name }}">
{{ end }} {{ end }}
{{ end }} {{ end }}
</div> </div>

View file

@ -7,7 +7,8 @@
{{ $path := printf "/links/%s" $banner}} {{ $path := printf "/links/%s" $banner}}
{{ $img := resources.Get $path }} {{ $img := resources.Get $path }}
{{ with $img }} {{ with $img }}
<img src="{{ .RelPermalink }}" style="width: auto; height: 31px;" alt="{{ $label }}" width="{{ .Width }}" height="{{ .Height }}"/> <!-- Some browsers (safari) sucks and blocks 88x31, so force them to be 89x31 instead. -->
<img src="{{ .RelPermalink }}" style="width: auto; height: 31px; image-rendering: pixelated;" alt="{{ $label }}" width="{{ add .Width 1 }}" height="{{ .Height }}"/>
{{ end }} {{ end }}
</a> </a>