1
0
Fork 0
mirror of https://github.com/GuerillaStudio/now-playing synced 2024-11-19 19:42:47 +00:00
now-playing/layouts/partials/musics.html
2019-12-03 22:03:44 +01:00

25 lines
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'"
>
</a>
</div>
{{ end }}
</div>