mirror of
https://github.com/GuerillaStudio/now-playing
synced 2025-01-01 16:41:56 +00:00
Serve covers as webp
This commit is contained in:
parent
c698ed7faf
commit
bf33dc92ac
2 changed files with 6 additions and 6 deletions
|
@ -29,9 +29,9 @@
|
|||
<div class="album-layout">
|
||||
<picture class="album-cover">
|
||||
{{ $original := resources.Get .Params.cover }}
|
||||
{{ $coverSmall := $original.Resize "x250" }}
|
||||
{{ $coverMedium := $original.Resize "x500" }}
|
||||
{{ $coverBig := $original.Resize "x1000" }}
|
||||
{{ $coverSmall := $original.Resize "x250 webp" }}
|
||||
{{ $coverMedium := $original.Resize "x500 webp" }}
|
||||
{{ $coverBig := $original.Resize "x1000 webp" }}
|
||||
{{ $placeholder := $original.Resize "x1" }}
|
||||
<source srcset="{{ $coverSmall.Permalink }} 1x, {{ $coverMedium.Permalink }} 2x" media="(max-width: 427px)">
|
||||
<source srcset="{{ $coverMedium.Permalink }} 1x, {{ $coverBig.Permalink }} 2x" media="(max-width: 480px)">
|
||||
|
|
|
@ -36,9 +36,9 @@
|
|||
{{ range sort $paginator.Pages "Date" "desc" }}
|
||||
{{ $original := resources.Get .Params.cover }}
|
||||
{{ $originalPermalink := $original.Permalink }}
|
||||
{{ $cover := $original.Resize "x320" }}
|
||||
{{ $cover2x := $original.Resize "x640" }}
|
||||
{{ $placeholder := $cover.Resize "x1" }}
|
||||
{{ $cover := $original.Resize "x320 webp" }}
|
||||
{{ $cover2x := $original.Resize "x640 webp" }}
|
||||
{{ $placeholder := $cover.Resize "x1 png" }}
|
||||
<div class="catalog-item">
|
||||
<a class="catalog-item__content" href="{{ .Permalink }}">
|
||||
<h2 class="catalog-item__album">{{ .Title }}</h2>
|
||||
|
|
Loading…
Reference in a new issue