/
mix.njk
175 lines (175 loc) · 6.23 KB
/
mix.njk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
---
layout: layout.njk
eleventyComputed:
title: "{{ mix.title }} - {{ mix.subtitle }} - Deep House Mixes - London, UK"
description: "A continuous deep house DJ mix, recorded live in {{ mix.month }}, featuring music from {{ mix.artists | join(', ') }}."
image: "mix/{{ mix.slug }}"
pagination:
data: mix
size: 1
alias: mix
permalink: "/mix/{{ mix.slug }}/index.html"
---
<div class="col col-sm-12 pb-3">
<main class="card shadow bg-thistle">
<article class="card-body">
<div class="d-flex flex-nowrap">
<div class="w-100">
<h2 class="card-title pb-1 h3">{{ mix.title }}</h2>
<p class="small pb-2">
{% if mix.summary %}{{ mix.summary }}{% else -%}
Recorded live in {{ mix.month }}
{% if mix.month != mix.subtitle %}for {{ mix.subtitle }}{% endif %}
{%- endif %}
</p>
<p>
<audio src="https://hearthis.app/deephouse-uk/{{ mix.slug }}/listen/"
preload="metadata" controls class="w-100 rounded"></audio>
</p>
<span
class="position-absolute top-0 end-0 badge rounded-pill m-3"
style="background-color: #eee">
<span style="color: #000">
{% if mix.popularity > 42 %}
<svg class="align-bottom me-1" xmlns="http://www.w3.org/2000/svg" width="14" height="14" role="img">
<title>🎧</title>
<use href="#headphones-000" />
</svg>
{{ mix.popularity }}{% else %}NEW{% endif %}
</span>
</span>
</div>
</div>
<div class="flex-shrink-1 d-block ms-3">
<picture>
<source srcset="/images/mix/{{ mix.slug }}.avif" type="image/avif">
<img
src="/images/mix/{{ mix.slug }}.jpg"
width="137" height="137"
class="float-end rounded ms-2"
alt="{{ mix.title }} - Cover">
</picture>
</div>
{% if mix.bpm > 0 %}<p class="small pb-2">{{ mix.bpm }} BPM</p>{% endif %}
<ol style="line-height:1.6">
{% for track in mix.tracklist %}
<li>{{ track }}</li>
{%- endfor %}
</ol>
{% if mix.photoCredit %}<p class="small text-muted d-none d-md-block">{{ mix.photoCredit }}</p>{% endif %}
<p>
{% if mix.mixcloudSlug %}<a
href="https://www.mixcloud.com/deephouse-uk/{{ mix.mixcloudSlug }}/"
class="btn btn-sm btn-outline-secondary"
rel="noreferrer"
>Listen via Mixcloud</a
>{% else %}<a
href="https://hearthis.at/deephouse-uk/{{ mix.hearThisSlug }}/"
class="btn btn-sm btn-outline-secondary"
rel="noreferrer"
>Listen via HearThis</a
>{% endif %}
<a
href="https://hearthis.app/deephouse-uk/{{
mix.hearThisSlug
}}/download/"
class="btn btn-sm btn-outline-secondary"
rel="noreferrer"
>Download</a
>
<button id="share-mix" class="d-none btn btn-sm btn-outline-secondary">Share</button>
</p>
</article>
</main>
</div>
{% if mix.related %}
<div class="col col-sm-12 pb-3">
<footer class="card shadow bg-thistle">
<div class="card-body pb-3">
<h3 class="card-title pb-1 h5">Related Mixes</h3>
<div class="row row-cols-2 row-cols-sm-3 row-cols-xl-6 g-4">
{% for related in mix.related %}
<article class="col">
<div class="card h-100" style="background-color: #{{ related.colour }}33">
<picture>
<source srcset="/images/mix/{{ related.slug }}.avif" type="image/avif">
<img
src="/images/mix/{{ related.slug }}.jpg"
class="card-img-top"
style="aspect-ratio: 1/1"
alt="{{ related.title }} - Cover"
loading="lazy">
</picture>
<span
class="position-absolute top-0 end-0 badge rounded-pill m-2"
style="background-color: #{{ related.colour }}"
>
<span style="color: #{{ related.colourContrast }}">
{% if related.popularity > 42 %}
<svg class="align-bottom me-1" xmlns="http://www.w3.org/2000/svg" width="14" height="14" role="img">
<title>🎧</title>
<use href="#headphones-{{ related.colourContrast }}" />
</svg>
{{ related.popularity }}{% else %}NEW{% endif %}
</span>
</span>
<div class="card-body">
<h2 class="card-title h5">{{ related.title }}</h2>
<h3 class="card-subtitle h6 fw-normal mt-2">{{ related.subtitle }}</h3>
<a
href="/mix/{{ related.slug }}/"
class="stretched-link"
title="{{ related.title }}"
></a>
</div>
</div>
</article>
{% endfor %}
</div>
</div>
</footer>
</div>
{% endif %}
<script>
if (navigator.share) {
document.addEventListener("DOMContentLoaded", () => {
const shareMix = document.getElementById("share-mix");
shareMix.addEventListener("click", () => navigator.share({url: "https://deephouse.uk/mix/{{ mix.slug }}/"}));
shareMix
.classList
.remove("d-none");
});
}
</script>
<script type="application/ld+json">
{
"@context": "https://schema.org/",
"@type": "PodcastEpisode",
"associatedMedia": {
"@type": "MediaObject",
"contentUrl": "https://hearthis.at/deephouse-uk/{{ mix.hearThisSlug }}/download/"
},
"datePublished": "{{ mix.date.toISOString() }}",
"description": "{{ description | safe }}",
"hasPart": [
{% for track in mix.tracklist %}{
"@type": "MusicRecording",
"name": "{{ track }}"
}{% if not loop.last %},{% endif %}
{% endfor %}
],
"interactionStatistic": {
"@type": "InteractionCounter",
"interactionType": "https://schema.org/ListenAction",
"userInteractionCount": "{{ mix.popularity }}"
},
"name": "{{ mix.title }} - {{ mix.subtitle }}",
"partOfSeries": {
"@type": "PodcastSeries",
"name": "Deep House Mixes - London, UK",
"url": "https://deephouse.uk"
},
"timeRequired": "PT{{ mix.durationSeconds }}S",
"url": "https://deephouse.uk/mix/{{ mix.slug }}/"
}
</script>