1
0
Fork 0
mirror of https://github.com/GuerillaStudio/now-playing synced 2024-12-30 12:01:56 +00:00
now-playing/layouts/index.html
2022-02-10 23:26:56 +01:00

82 lines
3.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{ define "metaTitle" }}
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" "musics") }}
<title>{{ if (not $paginator.HasPrev) }}{{ .Site.Title }} ∴ Handpicked Albums by the Glitch Family{{ else }}{{ .Site.Title }} ∴ Albums (Page {{ $paginator.PageNumber }}) {{ end }}</title>
<meta name="description" content="Handpicked Albums by the Glitch Family">
{{ end }}
{{ define "main" }}
{{ $paginator := .Paginate (where .Site.RegularPages "Type" "in" "musics") }}
<main>
{{ if and .IsHome (not $paginator.HasPrev) }}
<div class="home-head">
<div class="container">
<div class="home-head__container">
<h1 class="home-head__title" data-text="Handpicked Albums">
<span class="glitch" data-text="Handpicked">Handpicked</span> <span class="glitch" data-text="Albums">Albums</span>
</h1>
<p class="home-head__subtitle">by the Glitch Family</p>
</div>
</div>
</div>
{{ 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>
</div>
{{ end }}
<!-- Album list -->
<div class="content">
<div class="container">
<div class="grid grid-catalog">
{{ range sort $paginator.Pages "Date" "desc" }}
{{ $original := resources.Get .Params.cover }}
{{ $originalPermalink := $original.Permalink }}
{{ $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>
<div class="catalog-item__artist">by {{ .Params.artist }}</div>
<img
class="catalog-item__visual coverGlitchSimpleHover"
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"
loading="lazy"
alt="{{ .Title }} album's cover'"
title="{{ .Title }} album's cover'"
>
</a>
</div>
{{ end }}
</div>
{{ partial "pagination" . }}
</div>
</div>
<!-- About -->
{{ if not $paginator.HasPrev }}
<section class="home-about">
<div class="container">
<h2 class="visually-hidden">About</h2>
<p>At Glitch Family we love music, I mean we LOVE music! And we also LOVE great album covers. So we decided to make a place where we can showcase albums that are dear to us.</p>
<p>
This is Now Playing.<br>
A Glitch Familys project.
</p>
</div>
</section>
{{ end }}
</main>
{{ partial "cover-glitch-svg-filter" .}}
{{ end }}