2019-12-03 19:53:14 +00:00
{{ define "metaTitle" }}
2022-04-22 23:23:53 +00:00
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" "a") }}
2023-07-24 13:14:51 +00:00
< title > {{ if (not $paginator.HasPrev) }}{{ .Site.Title }} ∴ {{ .Site.Params.author.name }}'s Handpicked Albums Collection{{ else }}{{ .Site.Title }} ∴ Albums (Page {{ $paginator.PageNumber }}) {{ end }}< / title >
2023-02-20 01:08:02 +00:00
< meta name = "description" content = "{{ .Site.Params.description }}" >
2023-02-21 21:04:00 +00:00
{{ if (not $paginator.HasPrev) }}
< link rel = "preload" href = "/images/illustration.svg" as = "image" type = "image/svg+xml" / >
{{ end }}
2019-12-03 19:53:14 +00:00
{{ end }}
2019-11-27 02:56:03 +00:00
{{ define "main" }}
2022-04-22 23:23:53 +00:00
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" "a") }}
2019-11-28 01:05:31 +00:00
< main >
2020-08-05 16:46:12 +00:00
{{ if and .IsHome (not $paginator.HasPrev) }}
2019-11-28 01:05:31 +00:00
< div class = "home-head" >
< div class = "container" >
< div class = "home-head__container" >
2023-02-21 18:09:08 +00:00
< h1 class = "home-head__title" > Handpicked Albums< / h1 >
2023-07-24 12:41:02 +00:00
< p class = "home-head__subtitle" > A collection by {{ .Site.Params.author.name }}< / p >
2019-11-28 01:05:31 +00:00
< / div >
2019-11-27 17:06:26 +00:00
< / div >
< / div >
2019-11-28 01:05:31 +00:00
{{ else }}
< div class = "catalog-head" >
< div class = "container" >
< h1 class = "catalog-head__title" >
< span class = "catalog-head__title--primary" > Albums< / span >
< span class = "catalog-head__title--secondary" > Page {{ $paginator.PageNumber }}< / span >
< / h1 >
< / div >
2019-11-27 17:06:26 +00:00
< / div >
2019-11-28 01:05:31 +00:00
{{ end }}
2019-11-27 02:56:03 +00:00
2019-11-27 17:06:26 +00:00
<!-- Album list -->
< div class = "content" >
< div class = "container" >
2019-11-28 01:05:31 +00:00
< div class = "grid grid-catalog" >
2023-02-21 20:43:36 +00:00
{{ range $albumIndex, $album := sort $paginator.Pages "Date" "desc" }}
2019-11-28 01:05:31 +00:00
{{ $original := resources.Get .Params.cover }}
2019-12-03 23:41:09 +00:00
{{ $originalPermalink := $original.Permalink }}
2022-02-10 22:26:56 +00:00
{{ $cover := $original.Resize "x320 webp" }}
{{ $cover2x := $original.Resize "x640 webp" }}
{{ $placeholder := $cover.Resize "x1 png" }}
2019-11-28 01:05:31 +00:00
< div class = "catalog-item" >
< a class = "catalog-item__content" href = "{{ .Permalink }}" >
2023-05-12 01:30:18 +00:00
< h2 class = "catalog-item__album" style = "view-transition-name: album_title_{{ .File.BaseFileName }};" > {{ .Title }}< / h2 >
< div class = "catalog-item__artist" style = "view-transition-name: album_artist_{{ .File.BaseFileName }};" > by {{ .Params.artist }}< / div >
2019-11-28 01:05:31 +00:00
< img
2023-02-21 18:09:08 +00:00
class="catalog-item__visual"
2019-11-28 01:05:31 +00:00
width="320"
height="320"
2023-05-12 01:30:18 +00:00
style="
background-image: url(data:{{ $placeholder.MediaType }};base64,{{ $placeholder.Content | base64Encode }});
view-transition-name: album_cover_{{ .File.BaseFileName }};
"
2019-11-28 01:05:31 +00:00
src="{{ $cover.Permalink }}"
srcset="{{ $cover.Permalink }} 1x, {{ $cover2x.Permalink }} 2x"
2023-02-21 20:43:36 +00:00
{{ if ( gt $albumIndex 3) }}
2020-08-05 16:37:31 +00:00
loading="lazy"
2023-02-21 20:43:36 +00:00
decoding="async"
{{ end }}
2022-04-23 00:03:45 +00:00
alt="{{ .Title }} album's cover"
title="{{ .Title }} album's cover"
2019-11-28 01:05:31 +00:00
>
< / a >
< / div >
{{ end }}
< / div >
2019-11-27 17:06:26 +00:00
{{ partial "pagination" . }}
< / div >
< / div >
<!-- About -->
2023-07-24 13:12:47 +00:00
{{ if and (not $paginator.HasPrev) (eq .Site.Params.author.name .Site.Params.creator.name) }}
2019-11-28 01:05:31 +00:00
< section class = "home-about" >
< div class = "container" >
< h2 class = "visually-hidden" > About< / h2 >
2023-07-24 12:41:02 +00:00
< p > At {{ .Site.Params.author.name }} we love music, I mean we < strong class = "semibold" > LOVE< / strong > music! And we also LOVE great album covers. So we decided to make a place where we can showcase albums dear to us.< / p >
2019-11-28 01:05:31 +00:00
< p >
2023-02-20 01:08:02 +00:00
This is < strong class = "semibold" > Now Playing< / strong > , our little favorite albums collection.
2019-11-28 01:05:31 +00:00
< / p >
< / div >
< / section >
{{ end }}
2019-11-27 17:06:26 +00:00
< / main >
2020-03-23 11:20:29 +00:00
2019-11-27 02:56:03 +00:00
{{ end }}