mirror of
https://github.com/GuerillaStudio/now-playing
synced 2024-12-12 13:51:56 +00:00
27 lines
1.1 KiB
HTML
27 lines
1.1 KiB
HTML
{{ $pages := .Paginate (where .Site.RegularPages "Type" "in" "musics") }}
|
|
<div class="grid grid-catalog">
|
|
{{ range sort $pages.Pages "Date" "desc" }}
|
|
{{ $original := resources.Get .Params.cover }}
|
|
{{ $cover := $original.Resize "x320" }}
|
|
{{ $cover2x := $original.Resize "x640" }}
|
|
{{ $placeholder := $cover.Resize "x1" }}
|
|
<div class="catalog-item">
|
|
<a class="catalog-item__content" href="{{ .Permalink }}">
|
|
<h2 class="catalog-item__album">{{ .Title }}</h2>
|
|
<div class="catalog-item__artist">by {{ .Params.artist }}</div>
|
|
<img
|
|
class="catalog-item__visual"
|
|
width="320"
|
|
height="320"
|
|
style="background-image: url(data:{{ $placeholder.MediaType }};base64,{{ $placeholder.Content | base64Encode }});"
|
|
src="{{ $cover.Permalink }}"
|
|
srcset="{{ $cover.Permalink }} 1x, {{ $cover2x.Permalink }} 2x"
|
|
alt="{{ .Title }} album's cover'"
|
|
title="{{ .Title }} album's cover'"
|
|
loading="lazy"
|
|
decoding="async"
|
|
>
|
|
</a>
|
|
</div>
|
|
{{ end }}
|
|
</div>
|