1
0
Fork 0
mirror of https://github.com/GuerillaStudio/now-playing synced 2024-12-07 17:41:56 +00:00
now-playing/layouts/partials/musics.html

28 lines
1.1 KiB
HTML
Raw Normal View History

2022-04-22 23:23:53 +00:00
{{ $pages := .Paginate (where .Site.RegularPages "Type" "in" "a") }}
2019-11-27 17:06:26 +00:00
<div class="grid grid-catalog">
{{ range sort $pages.Pages "Date" "desc" }}
2019-11-27 02:56:03 +00:00
{{ $original := resources.Get .Params.cover }}
2019-11-27 17:06:26 +00:00
{{ $cover := $original.Resize "x320" }}
{{ $cover2x := $original.Resize "x640" }}
2019-11-27 02:56:03 +00:00
{{ $placeholder := $cover.Resize "x1" }}
2019-11-27 17:06:26 +00:00
<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"
2022-04-23 00:03:45 +00:00
alt="{{ .Title }} album's "
title="{{ .Title }} album's cover"
2022-04-07 15:32:45 +00:00
loading="lazy"
decoding="async"
2019-11-27 17:06:26 +00:00
>
</a>
2019-11-27 02:56:03 +00:00
</div>
2019-11-27 17:06:26 +00:00
{{ end }}
</div>